]> git.baikalelectronics.ru Git - kernel.git/commit
net/x25: Fix null-ptr-deref in x25_connect
authorMartin Schiller <ms@dev.tdt.de>
Mon, 9 Nov 2020 06:54:49 +0000 (07:54 +0100)
committerJakub Kicinski <kuba@kernel.org>
Wed, 11 Nov 2020 22:53:56 +0000 (14:53 -0800)
commitb20dddf54e866aba4840b8b9556f90a873f62e40
treee685ff875893dcc918eb7617a37ebad3c3a01271
parent6b8d391cd61680c80293222056ea2f41d5659f3f
net/x25: Fix null-ptr-deref in x25_connect

This fixes a regression for blocking connects introduced by commit
a9d7dc6b281f ("net/x25: Fix x25_neigh refcnt leak when x25 disconnect").

The x25->neighbour is already set to "NULL" by x25_disconnect() now,
while a blocking connect is waiting in
x25_wait_for_connection_establishment(). Therefore x25->neighbour must
not be accessed here again and x25->state is also already set to
X25_STATE_0 by x25_disconnect().

Fixes: a9d7dc6b281f ("net/x25: Fix x25_neigh refcnt leak when x25 disconnect")
Signed-off-by: Martin Schiller <ms@dev.tdt.de>
Reviewed-by: Xie He <xie.he.0141@gmail.com>
Link: https://lore.kernel.org/r/20201109065449.9014-1-ms@dev.tdt.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/x25/af_x25.c