Takeshi Misawa
fc0494ead6
net: qrtr: Fix memory leak in qrtr_tun_open
...
If qrtr_endpoint_register() failed, tun is leaked.
Fix this, by freeing tun in error path.
syzbot report:
BUG: memory leak
unreferenced object 0xffff88811848d680 (size 64):
comm "syz-executor684", pid 10171, jiffies 4294951561 (age 26.070s)
hex dump (first 32 bytes):
80 dd 0a 84 ff ff ff ff 00 00 00 00 00 00 00 00 ................
90 d6 48 18 81 88 ff ff 90 d6 48 18 81 88 ff ff ..H.......H.....
backtrace:
[<0000000018992a50>] kmalloc include/linux/slab.h:552 [inline]
[<0000000018992a50>] kzalloc include/linux/slab.h:682 [inline]
[<0000000018992a50>] qrtr_tun_open+0x22/0x90 net/qrtr/tun.c:35
[<0000000003a453ef>] misc_open+0x19c/0x1e0 drivers/char/misc.c:141
[<00000000dec38ac8>] chrdev_open+0x10d/0x340 fs/char_dev.c:414
[<0000000079094996>] do_dentry_open+0x1e6/0x620 fs/open.c:817
[<000000004096d290>] do_open fs/namei.c:3252 [inline]
[<000000004096d290>] path_openat+0x74a/0x1b00 fs/namei.c:3369
[<00000000b8e64241>] do_filp_open+0xa0/0x190 fs/namei.c:3396
[<00000000a3299422>] do_sys_openat2+0xed/0x230 fs/open.c:1172
[<000000002c1bdcef>] do_sys_open fs/open.c:1188 [inline]
[<000000002c1bdcef>] __do_sys_openat fs/open.c:1204 [inline]
[<000000002c1bdcef>] __se_sys_openat fs/open.c:1199 [inline]
[<000000002c1bdcef>] __x64_sys_openat+0x7f/0xe0 fs/open.c:1199
[<00000000f3a5728f>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
[<000000004b38b7ec>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
Fixes: 28fb4e59a47d ("net: qrtr: Expose tunneling endpoint to user space")
Reported-by: syzbot+5d6e4af21385f5cfc56a@syzkaller.appspotmail.com
Signed-off-by: Takeshi Misawa <jeliantsurux@gmail.com>
Link: https://lore.kernel.org/r/20210221234427.GA2140@DESKTOP
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-02-23 15:38:22 -08:00
..
2021-01-27 17:04:12 -08:00
2021-01-14 18:34:50 -08:00
2021-02-12 16:40:28 -08:00
2021-01-29 18:24:05 -08:00
2021-02-08 11:32:40 -08:00
2021-02-11 14:59:01 -08:00
2021-01-20 12:16:11 -08:00
2021-01-27 17:04:12 -08:00
2021-02-16 14:47:46 -08:00
2021-02-15 13:21:48 -08:00
2021-01-27 18:53:10 -08:00
2021-01-21 16:49:59 +01:00
2021-02-16 17:51:13 -08:00
2021-01-27 17:03:52 -08:00
2021-02-06 11:15:28 -08:00
2021-01-27 17:33:46 -08:00
2021-01-27 17:04:12 -08:00
2021-02-22 18:50:42 -08:00
2020-11-17 14:15:03 -08:00
2021-02-11 13:24:44 -08:00
2021-02-11 13:24:44 -08:00
2020-11-16 08:08:54 -08:00
2021-01-27 17:04:12 -08:00
2021-02-23 11:29:52 -08:00
2021-02-23 11:29:52 -08:00
2021-01-28 20:36:22 -08:00
2021-01-07 16:08:37 -08:00
2021-01-04 10:05:50 +01:00
2020-11-23 18:36:21 -05:00
2021-01-27 17:03:52 -08:00
2021-02-02 08:40:48 -08:00
2021-01-27 17:04:12 -08:00
2021-02-12 09:33:34 +01:00
2020-11-07 10:40:56 -08:00
2020-11-03 12:55:53 -08:00
2021-02-22 18:54:59 -08:00
2020-12-23 12:22:23 -08:00
2021-02-15 18:17:15 +01:00
2020-11-19 19:08:46 -08:00
2021-02-12 16:31:46 -08:00
2021-02-20 21:28:04 -08:00
2021-01-14 16:32:14 -08:00
2021-02-06 14:59:28 -08:00
2021-01-27 17:04:12 -08:00
2021-02-23 15:38:22 -08:00
2021-02-02 08:44:08 -08:00
2020-12-11 12:47:17 +01:00
2020-11-20 10:04:58 -08:00
2021-02-12 16:42:05 -08:00
2021-02-23 12:23:44 -08:00
2021-02-10 13:30:12 -08:00
2021-01-12 20:22:01 -08:00
2021-02-21 10:22:20 -08:00
2021-02-14 17:38:11 -08:00
2021-01-27 18:50:07 -08:00
2021-02-11 19:08:06 -08:00
2021-02-09 15:31:22 -08:00
2021-02-12 09:33:34 +01:00
2020-12-12 17:15:33 -08:00
2021-01-25 23:56:33 +01:00
2021-02-09 11:23:41 -08:00
2021-02-11 19:08:06 -08:00
2021-01-27 17:03:52 -08:00
2021-01-20 14:23:00 -08:00