YueHaibing
8999dc8949
net/x25: Fix null-ptr-deref in x25_disconnect
...
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: 4becb7ee5b
("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 >
2020-04-28 14:08:59 -07:00
..
2020-03-27 09:29:56 +00:00
2020-02-24 13:02:53 -08:00
2020-02-17 14:30:54 -08:00
2020-02-04 03:05:26 +00:00
2020-01-09 18:41:40 -08:00
2020-04-21 10:08:05 +02:00
2020-03-25 22:16:08 +01:00
2020-03-28 18:13:18 +01:00
2020-04-03 13:12:26 -07:00
2020-03-20 08:52:20 -07:00
2020-03-11 22:55:25 -07:00
2020-03-30 12:42:41 +02:00
2020-04-25 20:49:32 -07:00
2020-02-29 15:53:35 -08:00
2020-03-23 21:57:44 -07:00
2020-03-29 12:40:41 +01:00
2020-04-22 19:22:59 -07:00
2020-01-27 11:09:31 +01:00
2020-03-29 22:32:37 -07:00
2020-04-07 18:34:18 -07:00
2020-03-03 13:28:48 -08:00
2020-04-22 19:57:39 -07:00
2020-04-22 12:32:11 -07:00
2020-03-16 17:14:02 -07:00
2020-04-08 14:30:46 -07:00
2020-02-26 20:38:13 -08:00
2020-04-24 11:31:20 +02:00
2020-03-29 22:30:57 -07:00
2020-04-25 20:38:54 -07:00
2020-01-09 18:36:22 -08:00
2020-04-21 11:50:31 -07:00
2020-04-22 19:55:01 -07:00
2020-03-25 18:58:11 -07:00
2020-04-18 13:09:46 -07:00
2020-03-12 22:34:48 -07:00
2020-04-20 10:53:54 -07:00
2020-03-15 00:25:25 -07:00
2020-01-03 12:25:50 -08:00
2020-04-09 10:08:31 -07:00
2020-04-15 12:33:29 -07:00
2020-01-26 10:40:21 +01:00
2020-04-14 16:26:47 -07:00
2020-04-27 11:49:57 -07:00
2020-04-22 19:27:40 -07:00
2020-03-12 22:34:48 -07:00
2020-04-17 12:40:38 -04:00
2020-02-26 20:58:33 -08:00
2020-04-18 13:24:20 -07:00
2020-04-27 11:22:38 -07:00
2020-02-28 12:12:53 -08:00
2020-04-27 10:18:01 -07:00
2020-04-14 12:28:48 +02:00
2020-04-28 14:08:59 -07:00
2020-04-15 13:07:18 +02:00
2020-03-30 10:59:20 -07:00
2020-03-10 09:12:49 -06:00
2020-03-25 12:24:33 -07:00
2020-01-24 13:44:07 +01:00
2020-03-30 12:18:49 -07:00