alistair23-linux/net/x25
Xie He 4ee18c179e net: x25: Increase refcnt of "struct x25_neigh" in x25_rx_call_request
The x25_disconnect function in x25_subr.c would decrease the refcount of
"x25->neighbour" (struct x25_neigh) and reset this pointer to NULL.

However, the x25_rx_call_request function in af_x25.c, which is called
when we receive a connection request, does not increase the refcount when
it assigns the pointer.

Fix this issue by increasing the refcount of "struct x25_neigh" in
x25_rx_call_request.

This patch fixes frequent kernel crashes when using AF_X25 sockets.

Fixes: 4becb7ee5b ("net/x25: Fix x25_neigh refcnt leak when x25 disconnect")
Cc: Martin Schiller <ms@dev.tdt.de>
Signed-off-by: Xie He <xie.he.0141@gmail.com>
Link: https://lore.kernel.org/r/20201112103506.5875-1-xie.he.0141@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2020-11-12 18:01:40 -08:00
..
af_x25.c net: x25: Increase refcnt of "struct x25_neigh" in x25_rx_call_request 2020-11-12 18:01:40 -08:00
Kconfig Replace HTTP links with HTTPS ones: X.25 network layer 2020-07-07 15:44:44 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sysctl_net_x25.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
x25_dev.c net/x25: Fix x25_neigh refcnt leak when receiving frame 2020-04-23 15:39:39 -07:00
x25_facilities.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
x25_forward.c net: x25: convert to list_for_each_entry_safe() 2020-02-16 18:59:42 -08:00
x25_in.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
x25_link.c net: x25: kerneldoc fixes 2020-07-13 17:20:40 -07:00
x25_out.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 41 2019-05-24 17:27:12 +02:00
x25_proc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 41 2019-05-24 17:27:12 +02:00
x25_route.c net: x25: kerneldoc fixes 2020-07-13 17:20:40 -07:00
x25_subr.c net/x25: Fix null-ptr-deref in x25_disconnect 2020-04-28 14:08:59 -07:00
x25_timer.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 41 2019-05-24 17:27:12 +02:00