Liu Shixin
1c12909a78
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:22:59 +01:00
..
2021-09-15 09:47:31 +02:00
2022-12-08 11:22:58 +01:00
2021-07-31 08:19:38 +02:00
2021-12-01 09:23:34 +01:00
2021-04-07 14:47:41 +02:00
2022-10-29 10:20:35 +02:00
2022-04-20 09:19:40 +02:00
2022-05-18 09:47:24 +02:00
2022-11-25 17:42:13 +01:00
2022-11-25 17:42:21 +01:00
2021-07-14 16:53:33 +02:00
2022-09-28 11:04:07 +02:00
2022-11-25 17:42:15 +01:00
2022-11-25 17:42:10 +01:00
2020-11-05 11:43:34 +01:00
2022-11-25 17:42:04 +01:00
2022-03-08 19:07:51 +01:00
2022-08-25 11:17:49 +02:00
2021-07-28 13:30:56 +02:00
2020-04-23 10:36:45 +02:00
2022-03-23 09:12:07 +01:00
2020-01-09 10:20:06 +01:00
2021-05-14 09:44:10 +02:00
2022-11-03 23:56:54 +09:00
2022-11-25 17:42:21 +01:00
2022-12-08 11:22:58 +01:00
2021-03-07 12:20:42 +01:00
2022-11-25 17:42:21 +01:00
2022-12-08 11:22:57 +01:00
2022-06-22 14:11:21 +02:00
2022-04-27 13:50:47 +02:00
2021-02-10 09:25:28 +01:00
2022-03-28 08:46:48 +02:00
2022-12-08 11:22:57 +01:00
2022-11-03 23:56:53 +09:00
2021-12-08 09:01:12 +01:00
2022-01-05 12:37:45 +01:00
2022-11-10 17:57:51 +01:00
2022-04-15 14:18:35 +02:00
2022-05-18 09:47:25 +02:00
2021-07-28 13:30:56 +02:00
2022-12-08 11:22:59 +01:00
2022-11-03 23:56:56 +09:00
2022-09-05 10:27:48 +02:00
2022-01-11 15:23:33 +01:00
2021-09-03 10:08:12 +02:00
2022-10-26 13:22:26 +02:00
2020-11-24 13:29:05 +01:00
2022-11-10 17:57:51 +01:00
2022-09-28 11:03:58 +02:00
2022-11-10 17:57:50 +01:00
2022-10-26 13:22:26 +02:00
2022-09-15 12:04:50 +02:00
2021-11-17 09:48:48 +01:00
2022-09-05 10:27:40 +02:00
2021-10-27 09:54:24 +02:00
2022-12-08 11:22:58 +01:00
2022-07-29 17:14:12 +02:00
2022-10-26 13:22:59 +02:00
2022-10-26 13:22:25 +02:00
2022-11-25 17:42:04 +01:00
2022-11-25 17:42:16 +01:00
2021-12-22 09:29:40 +01:00
2022-10-26 13:22:49 +02:00
2021-06-18 09:59:00 +02:00
2020-04-01 11:02:18 +02:00
2022-09-05 10:27:42 +02:00