[syzbot] memory leak in reg_copy_regd

16 views
Skip to first unread message

syzbot

unread,
Jul 22, 2021, 2:12:18 AM7/22/21
to da...@davemloft.net, joha...@sipsolutions.net, ku...@kernel.org, linux-...@vger.kernel.org, linux-w...@vger.kernel.org, net...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: d980cc0620ae Merge tag 'devicetree-fixes-for-5.14-1' of gi..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=142c634a300000
kernel config: https://syzkaller.appspot.com/x/.config?x=7280943fd0476e5a
dashboard link: https://syzkaller.appspot.com/bug?extid=1638e7c770eef6b6c0d0
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=131de45a300000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=118cea5c300000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+1638e7...@syzkaller.appspotmail.com

BUG: memory leak
unreferenced object 0xffff888111969200 (size 512):
comm "syz-executor817", pid 8828, jiffies 4294955311 (age 19.340s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
05 00 00 00 39 39 00 00 00 00 00 00 d0 a6 24 00 ....99........$.
backtrace:
[<ffffffff83e971f0>] kmalloc include/linux/slab.h:596 [inline]
[<ffffffff83e971f0>] kzalloc include/linux/slab.h:721 [inline]
[<ffffffff83e971f0>] reg_copy_regd+0x30/0x120 net/wireless/reg.c:444
[<ffffffff83e98e21>] wiphy_apply_custom_regulatory+0x101/0x1a0 net/wireless/reg.c:2582
[<ffffffff82b31e27>] mac80211_hwsim_new_radio+0x897/0x1300 drivers/net/wireless/mac80211_hwsim.c:3344
[<ffffffff82b32cb5>] hwsim_new_radio_nl+0x425/0x5f0 drivers/net/wireless/mac80211_hwsim.c:3924
[<ffffffff83867aa3>] genl_family_rcv_msg_doit+0x113/0x180 net/netlink/genetlink.c:739
[<ffffffff83868184>] genl_family_rcv_msg net/netlink/genetlink.c:783 [inline]
[<ffffffff83868184>] genl_rcv_msg+0x174/0x2c0 net/netlink/genetlink.c:800
[<ffffffff83866857>] netlink_rcv_skb+0x87/0x1d0 net/netlink/af_netlink.c:2504
[<ffffffff83867164>] genl_rcv+0x24/0x40 net/netlink/genetlink.c:811
[<ffffffff83865a42>] netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline]
[<ffffffff83865a42>] netlink_unicast+0x392/0x4c0 net/netlink/af_netlink.c:1340
[<ffffffff83865edb>] netlink_sendmsg+0x36b/0x6b0 net/netlink/af_netlink.c:1929
[<ffffffff836cf446>] sock_sendmsg_nosec net/socket.c:703 [inline]
[<ffffffff836cf446>] sock_sendmsg+0x56/0x80 net/socket.c:723
[<ffffffff836cf9ac>] ____sys_sendmsg+0x36c/0x390 net/socket.c:2392
[<ffffffff836d39fb>] ___sys_sendmsg+0x8b/0xd0 net/socket.c:2446
[<ffffffff836d3af8>] __sys_sendmsg+0x88/0x100 net/socket.c:2475
[<ffffffff843af915>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
[<ffffffff843af915>] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
[<ffffffff84400068>] entry_SYSCALL_64_after_hwframe+0x44/0xae



---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

syzbot

unread,
Jul 22, 2021, 3:37:09 AM7/22/21
to mudongl...@gmail.com, syzkall...@googlegroups.com
Hello,

syzbot tried to test the proposed patch but the build/boot failed:

drivers/net/wireless/mac80211_hwsim.c:3408:3: error: implicit declaration of function 'rcu_free_regdom' [-Werror=implicit-function-declaration]
drivers/net/wireless/mac80211_hwsim.c:3408:40: error: passing argument 1 of 'get_wiphy_regdom' from incompatible pointer type [-Werror=incompatible-pointer-types]
drivers/net/wireless/mac80211_hwsim.c:3460:40: error: passing argument 1 of 'get_wiphy_regdom' from incompatible pointer type [-Werror=incompatible-pointer-types]


Tested on:

commit: 3d5895cd Merge tag 's390-5.14-3' of git://git.kernel.o..
git tree: upstream
dashboard link: https://syzkaller.appspot.com/bug?extid=1638e7c770eef6b6c0d0
compiler:
patch: https://syzkaller.appspot.com/x/patch.diff?x=160408d4300000

syzbot

unread,
Jul 22, 2021, 7:56:10 AM7/22/21
to mudongl...@gmail.com, syzkall...@googlegroups.com
Hello,

syzbot tried to test the proposed patch but the build/boot failed:

drivers/net/wireless/mac80211_hwsim.c:3408:3: error: implicit declaration of function 'rcu_free_regdom' [-Werror=implicit-function-declaration]


Tested on:

commit: 3d5895cd Merge tag 's390-5.14-3' of git://git.kernel.o..
git tree: upstream
dashboard link: https://syzkaller.appspot.com/bug?extid=1638e7c770eef6b6c0d0
compiler:
patch: https://syzkaller.appspot.com/x/patch.diff?x=150740f4300000

syzbot

unread,
Jul 22, 2021, 4:52:10 PM7/22/21
to mudongl...@gmail.com, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+1638e7...@syzkaller.appspotmail.com

Tested on:

commit: 9f42f674 Merge tag 'arm64-fixes' of git://git.kernel.o..
git tree: upstream
kernel config: https://syzkaller.appspot.com/x/.config?x=e4b7f4d9a31ee6a3
dashboard link: https://syzkaller.appspot.com/bug?extid=1638e7c770eef6b6c0d0
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.1
patch: https://syzkaller.appspot.com/x/patch.diff?x=139cd8f4300000

Note: testing is done by a robot and is best-effort only.

syzbot

unread,
Jul 26, 2021, 3:29:13 AM7/26/21
to mudongl...@gmail.com, syzkall...@googlegroups.com
Hello,

syzbot tried to test the proposed patch but the build/boot failed:

net/wireless/core.c:1088:2: error: implicit declaration of function 'rcu_free_regdom' [-Werror=implicit-function-declaration]


Tested on:

commit: ff117646 Linux 5.14-rc3
git tree: upstream
patch: https://syzkaller.appspot.com/x/patch.diff?x=111ae1b2300000

syzbot

unread,
Jul 26, 2021, 5:36:08 AM7/26/21
to mudongl...@gmail.com, syzkall...@googlegroups.com

syzbot

unread,
Jul 26, 2021, 5:59:13 AM7/26/21
to mudongl...@gmail.com, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+1638e7...@syzkaller.appspotmail.com

Tested on:

commit: ff117646 Linux 5.14-rc3
git tree: upstream
kernel config: https://syzkaller.appspot.com/x/.config?x=4ebfe83ba9ca8666
dashboard link: https://syzkaller.appspot.com/bug?extid=1638e7c770eef6b6c0d0
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.1
patch: https://syzkaller.appspot.com/x/patch.diff?x=14585a92300000
Reply all
Reply to author
Forward
0 new messages