]> 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)
commit95776243fe328ce7e9ad9457013897df963790c3
treee685ff875893dcc918eb7617a37ebad3c3a01271
parente48ef1b3998d385d4ac5260adf36b527771a9a11
net/x25: Fix null-ptr-deref in x25_connect

This fixes a regression for blocking connects introduced by commit
ffcf38937155 ("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: ffcf38937155 ("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