Liu Shixin
b8da7e7ae8
NFC: nci: fix memory leak in nci_rx_data_packet()
[ Upstream commit 53270fb0fd ]
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: 4aeee6871e ("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>
2023-06-13 14:13:45 +09:00
..
2023-05-15 16:44:57 +09:00
2023-06-13 14:13:45 +09:00
2023-05-16 11:34:46 +09:00
2023-05-15 16:32:51 +09:00
2023-05-16 10:49:55 +09:00
2023-06-13 14:13:37 +09:00
2023-05-16 12:45:55 +09:00
2023-05-16 12:46:11 +09:00
2023-06-13 14:13:42 +09:00
2023-06-13 14:13:27 +09:00
2023-06-13 14:13:43 +09:00
2023-06-13 14:13:35 +09:00
2023-05-16 09:45:38 +09:00
2023-06-13 14:13:41 +09:00
2023-05-16 12:44:53 +09:00
2023-05-16 11:46:42 +09:00
2023-05-16 11:34:05 +09:00
2023-05-12 16:29:40 +09:00
2023-05-15 17:13:02 +09:00
2023-05-15 16:31:00 +09:00
2023-05-16 10:54:56 +09:00
2023-06-13 14:13:38 +09:00
2023-06-13 14:13:44 +09:00
2023-06-13 14:13:45 +09:00
2017-05-25 15:44:41 +02:00
2023-05-12 17:27:16 +09:00
2023-05-16 09:50:42 +09:00
2023-06-13 14:13:44 +09:00
2023-06-13 14:13:45 +09:00
2023-06-13 14:13:12 +09:00
2016-09-10 23:12:53 -07:00
2023-05-16 10:34:08 +09:00
2023-05-16 12:47:02 +09:00
2023-06-13 14:13:45 +09:00
2023-06-13 14:13:38 +09:00
2023-05-16 10:46:16 +09:00
2023-05-16 10:24:55 +09:00
2023-06-13 14:13:39 +09:00
2023-05-16 12:33:58 +09:00
2023-06-13 14:12:48 +09:00
2023-05-16 11:34:06 +09:00
2023-06-13 14:13:45 +09:00
2023-06-13 14:13:39 +09:00
2023-06-13 14:12:43 +09:00
2023-05-16 12:30:20 +09:00
2023-05-16 10:49:33 +09:00
2023-06-13 14:13:33 +09:00
2023-05-15 16:32:30 +09:00
2023-06-13 14:13:40 +09:00
2023-06-13 14:12:54 +09:00
2023-06-13 14:13:39 +09:00
2023-06-13 14:12:54 +09:00
2018-04-29 11:32:02 +02:00
2023-06-13 14:13:27 +09:00
2016-10-19 10:58:04 -04:00
2023-06-13 14:13:41 +09:00
2023-05-16 12:33:30 +09:00
2023-06-13 14:13:23 +09:00
2015-08-09 22:43:52 -07:00
2023-06-13 14:13:08 +09:00
2023-06-13 14:13:26 +09:00
2023-06-13 14:13:43 +09:00
2023-06-13 14:13:35 +09:00
2023-05-16 11:14:47 +09:00
2023-05-15 17:31:52 +09:00
2023-05-16 11:34:41 +09:00
2023-06-13 14:13:24 +09:00
2016-10-06 09:52:23 -07:00