Liu Shixin
b4e4315ced
NFC: nci: fix memory leak in nci_rx_data_packet()
...
[ Upstream commit 53270fb0fd77fe786d8c07a0793981d797836b93 ]
Syzbot reported a memory leak about skb:
unreferenced object 0xffff88810e144e00 (size 240):
comm "syz-executor284", pid 3701, jiffies 4294952403 (age 12.620s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<ffffffff83ab79a9>] __alloc_skb+0x1f9/0x270 net/core/skbuff.c:497
[<ffffffff82a5cf64>] alloc_skb include/linux/skbuff.h:1267 [inline]
[<ffffffff82a5cf64>] virtual_ncidev_write+0x24/0xe0 drivers/nfc/virtual_ncidev.c:116
[<ffffffff815f6503>] do_loop_readv_writev fs/read_write.c:759 [inline]
[<ffffffff815f6503>] do_loop_readv_writev fs/read_write.c:743 [inline]
[<ffffffff815f6503>] do_iter_write+0x253/0x300 fs/read_write.c:863
[<ffffffff815f66ed>] vfs_writev+0xdd/0x240 fs/read_write.c:934
[<ffffffff815f68f6>] do_writev+0xa6/0x1c0 fs/read_write.c:977
[<ffffffff848802d5>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
[<ffffffff848802d5>] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
[<ffffffff84a00087>] entry_SYSCALL_64_after_hwframe+0x63/0xcd
In nci_rx_data_packet(), if we don't get a valid conn_info, we will return
directly but forget to release the skb.
Reported-by: syzbot+cdb9a427d1bc08815104@syzkaller.appspotmail.com
Fixes: 4aeee6871e8c ("NFC: nci: Add dynamic logical connections support")
Signed-off-by: Liu Shixin <liushixin2@huawei.com>
Link: https://lore.kernel.org/r/20221118082419.239475-1-liushixin2@huawei.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-08 11:15:39 +01:00
..
2020-01-29 10:24:22 +01:00
2022-12-08 11:15:39 +01:00
2021-08-04 11:58:02 +02:00
2020-01-12 11:24:27 +01:00
2021-04-07 12:05:39 +02:00
2022-11-03 23:49:15 +09:00
2022-03-16 12:49:00 +01:00
2022-03-16 12:49:01 +01:00
2022-11-25 17:35:38 +01:00
2022-09-15 12:39:46 +02:00
2022-11-25 17:35:39 +01:00
2022-10-26 13:15:46 +02:00
2020-11-10 10:23:59 +01:00
2022-11-25 17:35:35 +01:00
2022-03-08 19:00:59 +01:00
2021-09-22 11:43:09 +02:00
2021-07-28 09:14:27 +02:00
2018-07-22 14:27:39 +02:00
2020-04-13 10:32:53 +02:00
2020-01-12 11:24:19 +01:00
2021-05-22 10:40:20 +02:00
2022-11-03 23:49:17 +09:00
2022-11-25 17:35:42 +01:00
2022-12-08 11:15:39 +01:00
2017-05-25 15:44:41 +02:00
2018-09-15 09:43:01 +02:00
2020-12-11 13:37:56 +01:00
2022-11-25 17:35:42 +01:00
2022-12-08 11:15:39 +01:00
2022-06-25 11:45:19 +02:00
2021-02-10 09:09:25 +01:00
2022-03-28 08:06:06 +02:00
2022-12-08 11:15:39 +01:00
2022-11-03 23:49:16 +09:00
2021-03-17 16:10:13 +01:00
2021-01-12 19:49:01 +01:00
2022-11-10 15:46:05 +01:00
2022-01-27 08:47:42 +01:00
2022-05-18 09:15:43 +02:00
2021-07-28 09:14:27 +02:00
2022-12-08 11:15:39 +01:00
2022-11-03 23:49:19 +09:00
2022-04-27 13:14:10 +02:00
2022-01-11 13:38:12 +01:00
2021-03-30 14:41:42 +02:00
2022-10-26 13:15:40 +02:00
2020-01-12 11:24:23 +01:00
2022-11-10 15:46:05 +01:00
2022-06-14 16:52:33 +02:00
2022-11-10 15:46:05 +01:00
2022-06-14 16:52:32 +02:00
2018-04-29 11:32:02 +02:00
2022-09-15 12:39:46 +02:00
2022-11-25 17:35:36 +01:00
2022-01-27 08:47:41 +01:00
2022-08-25 11:09:29 +02:00
2022-09-15 12:39:44 +02:00
2022-11-25 17:35:40 +01:00
2022-10-26 13:15:45 +02:00
2021-06-30 08:49:12 -04:00
2021-08-04 11:58:01 +02:00
2022-09-05 10:23:55 +02:00