YueHaibing
bbb13adb07
net/x25: Fix null-ptr-deref in x25_disconnect
...
commit 8999dc89497ab1c80d0718828e838c7cd5f6bffe upstream.
We should check null before do x25_neigh_put in x25_disconnect,
otherwise may cause null-ptr-deref like this:
#include <sys/socket.h>
#include <linux/x25.h>
int main() {
int sck_x25;
sck_x25 = socket(AF_X25, SOCK_SEQPACKET, 0);
close(sck_x25);
return 0;
}
BUG: kernel NULL pointer dereference, address: 00000000000000d8
CPU: 0 PID: 4817 Comm: t2 Not tainted 5.7.0-rc3+ #159
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.9.3-
RIP: 0010:x25_disconnect+0x91/0xe0
Call Trace:
x25_release+0x18a/0x1b0
__sock_release+0x3d/0xc0
sock_close+0x13/0x20
__fput+0x107/0x270
____fput+0x9/0x10
task_work_run+0x6d/0xb0
exit_to_usermode_loop+0x102/0x110
do_syscall_64+0x23c/0x260
entry_SYSCALL_64_after_hwframe+0x49/0xb3
Reported-by: syzbot+6db548b615e5aeefdce2@syzkaller.appspotmail.com
Fixes: 4becb7ee5b3d ("net/x25: Fix x25_neigh refcnt leak when x25 disconnect")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-05 09:59:44 +02:00
..
2019-07-06 12:50:01 +02:00
2020-08-05 09:59:42 +02:00
2019-06-19 17:09:55 +02:00
2020-01-12 12:21:50 +01:00
2019-09-24 16:37:18 +02:00
2019-11-18 17:08:20 -08:00
2020-07-31 18:39:31 +02:00
2020-06-22 09:30:56 +02:00
2020-06-22 09:30:54 +02:00
2019-07-25 18:00:41 -07:00
2020-04-21 09:04:53 +02:00
2020-07-22 09:32:46 +02:00
2019-10-28 13:33:41 -07:00
2019-12-31 16:45:56 +01:00
2020-07-22 09:33:17 +02:00
2020-07-31 18:39:31 +02:00
2020-06-17 16:40:32 +02:00
2020-01-04 19:18:58 +01:00
2020-04-23 10:36:45 +02:00
2020-06-03 08:21:38 +02:00
2020-01-09 10:20:06 +01:00
2020-04-21 09:04:44 +02:00
2020-03-18 07:17:44 +01:00
2019-09-26 08:56:17 +02:00
2020-07-31 18:39:31 +02:00
2020-07-31 18:39:31 +02:00
2019-07-29 10:26:14 -07:00
2019-09-27 10:27:14 +02:00
2019-07-08 19:48:57 -07:00
2020-07-22 09:32:47 +02:00
2019-06-23 13:24:17 -07:00
2019-06-17 20:20:36 -07:00
2020-07-22 09:32:47 +02:00
2020-07-29 10:18:26 +02:00
2019-12-18 16:08:42 +01:00
2019-09-19 18:04:40 -07:00
2020-07-29 10:18:34 +02:00
2020-05-20 08:20:08 +02:00
2020-07-22 09:32:46 +02:00
2020-04-29 16:33:08 +02:00
2020-03-18 07:17:46 +01:00
2019-06-19 17:09:55 +02:00
2020-06-30 15:36:45 -04:00
2020-04-01 11:01:35 +02:00
2019-10-28 13:33:41 -07:00
2019-12-04 22:30:54 +01:00
2020-07-31 18:39:30 +02:00
2020-08-05 09:59:44 +02:00
2020-01-12 12:21:33 +01:00
2019-10-24 14:53:48 -07:00
2020-07-31 18:39:31 +02:00
2020-07-22 09:32:48 +02:00
2020-07-31 18:39:31 +02:00
2020-03-18 07:17:59 +01:00
2019-06-22 08:59:24 -04:00
2020-08-05 09:59:41 +02:00
2020-06-03 08:21:03 +02:00
2020-06-22 09:31:12 +02:00
2020-01-17 19:48:52 +01:00
2020-07-29 10:18:31 +02:00
2019-08-10 15:25:47 -07:00
2020-07-16 08:16:37 +02:00
2020-08-05 09:59:44 +02:00
2020-06-24 17:50:44 +02:00
2020-06-30 15:36:53 -04:00
2020-04-01 11:02:18 +02:00
2020-01-17 19:48:52 +01:00