Takeshi Misawa
2d661ed357
net: Fix memory leak in ieee802154_raw_deliver
...
[ Upstream commit 1090340f7ee53e824fd4eef66a4855d548110c5b ]
If IEEE-802.15.4-RAW is closed before receive skb, skb is leaked.
Fix this, by freeing sk_receive_queue in sk->sk_destruct().
syzbot report:
BUG: memory leak
unreferenced object 0xffff88810f644600 (size 232):
comm "softirq", pid 0, jiffies 4294967032 (age 81.270s)
hex dump (first 32 bytes):
10 7d 4b 12 81 88 ff ff 10 7d 4b 12 81 88 ff ff .}K......}K.....
00 00 00 00 00 00 00 00 40 7c 4b 12 81 88 ff ff ........@|K.....
backtrace:
[<ffffffff83651d4a>] skb_clone+0xaa/0x2b0 net/core/skbuff.c:1496
[<ffffffff83fe1b80>] ieee802154_raw_deliver net/ieee802154/socket.c:369 [inline]
[<ffffffff83fe1b80>] ieee802154_rcv+0x100/0x340 net/ieee802154/socket.c:1070
[<ffffffff8367cc7a>] __netif_receive_skb_one_core+0x6a/0xa0 net/core/dev.c:5384
[<ffffffff8367cd07>] __netif_receive_skb+0x27/0xa0 net/core/dev.c:5498
[<ffffffff8367cdd9>] netif_receive_skb_internal net/core/dev.c:5603 [inline]
[<ffffffff8367cdd9>] netif_receive_skb+0x59/0x260 net/core/dev.c:5662
[<ffffffff83fe6302>] ieee802154_deliver_skb net/mac802154/rx.c:29 [inline]
[<ffffffff83fe6302>] ieee802154_subif_frame net/mac802154/rx.c:102 [inline]
[<ffffffff83fe6302>] __ieee802154_rx_handle_packet net/mac802154/rx.c:212 [inline]
[<ffffffff83fe6302>] ieee802154_rx+0x612/0x620 net/mac802154/rx.c:284
[<ffffffff83fe59a6>] ieee802154_tasklet_handler+0x86/0xa0 net/mac802154/main.c:35
[<ffffffff81232aab>] tasklet_action_common.constprop.0+0x5b/0x100 kernel/softirq.c:557
[<ffffffff846000bf>] __do_softirq+0xbf/0x2ab kernel/softirq.c:345
[<ffffffff81232f4c>] do_softirq kernel/softirq.c:248 [inline]
[<ffffffff81232f4c>] do_softirq+0x5c/0x80 kernel/softirq.c:235
[<ffffffff81232fc1>] __local_bh_enable_ip+0x51/0x60 kernel/softirq.c:198
[<ffffffff8367a9a4>] local_bh_enable include/linux/bottom_half.h:32 [inline]
[<ffffffff8367a9a4>] rcu_read_unlock_bh include/linux/rcupdate.h:745 [inline]
[<ffffffff8367a9a4>] __dev_queue_xmit+0x7f4/0xf60 net/core/dev.c:4221
[<ffffffff83fe2db4>] raw_sendmsg+0x1f4/0x2b0 net/ieee802154/socket.c:295
[<ffffffff8363af16>] sock_sendmsg_nosec net/socket.c:654 [inline]
[<ffffffff8363af16>] sock_sendmsg+0x56/0x80 net/socket.c:674
[<ffffffff8363deec>] __sys_sendto+0x15c/0x200 net/socket.c:1977
[<ffffffff8363dfb6>] __do_sys_sendto net/socket.c:1989 [inline]
[<ffffffff8363dfb6>] __se_sys_sendto net/socket.c:1985 [inline]
[<ffffffff8363dfb6>] __x64_sys_sendto+0x26/0x30 net/socket.c:1985
Fixes: 9ec767160357 ("net: add IEEE 802.15.4 socket family implementation")
Reported-and-tested-by: syzbot+1f68113fa907bf0695a8@syzkaller.appspotmail.com
Signed-off-by: Takeshi Misawa <jeliantsurux@gmail.com>
Acked-by: Alexander Aring <aahringo@redhat.com>
Link: https://lore.kernel.org/r/20210805075414.GA15796@DESKTOP
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-08-26 08:37:22 -04:00
..
2020-01-29 10:24:22 +01:00
2020-11-10 10:23:54 +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
2020-10-01 20:40:12 +02:00
2020-07-31 16:44:06 +02:00
2021-06-30 08:49:13 -04:00
2021-08-15 13:01:02 +02:00
2021-07-28 09:14:25 +02:00
2021-07-28 09:14:27 +02:00
2021-08-08 08:38:54 +02:00
2020-11-10 10:23:59 +01:00
2021-08-08 08:38:53 +02:00
2021-01-23 15:38:18 +01:00
2021-04-07 12:05:38 +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
2021-08-26 08:37:22 -04:00
2021-07-28 09:14:26 +02:00
2021-07-28 09:14:26 +02: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
2019-04-17 08:36:44 +02:00
2021-02-23 13:59:14 +01:00
2021-01-09 13:35:49 +01:00
2021-02-10 09:09:25 +01:00
2021-08-04 11:58:03 +02:00
2021-07-20 16:21:09 +02:00
2021-04-16 11:59:10 +02:00
2021-03-17 16:10:13 +01:00
2021-01-12 19:49:01 +01:00
2021-08-04 11:58:03 +02:00
2021-07-20 16:21:02 +02:00
2021-06-16 11:36:33 +02:00
2021-07-28 09:14:27 +02:00
2021-06-16 11:36:32 +02:00
2021-05-22 10:40:19 +02:00
2021-06-30 08:49:20 -04:00
2019-03-23 13:19:44 +01:00
2021-03-30 14:41:42 +02:00
2021-06-30 08:49:13 -04:00
2020-01-12 11:24:23 +01:00
2020-12-11 13:37:56 +01:00
2021-01-23 15:38:19 +01:00
2021-07-20 16:21:03 +02:00
2021-08-04 11:58:02 +02:00
2018-04-29 11:32:02 +02:00
2021-07-20 16:20:57 +02:00
2021-08-04 11:58:03 +02:00
2021-08-04 11:58:01 +02:00
2021-05-22 10:40:28 +02:00
2021-08-04 11:58:03 +02:00
2021-06-30 08:49:12 -04:00
2021-07-20 16:21:07 +02:00
2021-06-30 08:49:12 -04:00
2021-08-04 11:58:01 +02:00
2020-08-21 11:02:04 +02:00