[syzbot] memory leak in hwsim_add_one

40 views
Skip to first unread message

syzbot

unread,
Jun 7, 2021, 11:45:21 AM6/7/21
to alex....@gmail.com, da...@davemloft.net, ku...@kernel.org, linux-...@vger.kernel.org, linux...@vger.kernel.org, net...@vger.kernel.org, ste...@datenfreihafen.org, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 9d32fa5d Merge tag 'net-5.13-rc5' of git://git.kernel.org/..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=15dee1bbd00000
kernel config: https://syzkaller.appspot.com/x/.config?x=de8efb0998945e75
dashboard link: https://syzkaller.appspot.com/bug?extid=b80c9959009a9325cdff
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1706bbb5d00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14d708afd00000

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

Warning: Permanently added '10.128.1.19' (ECDSA) to the list of known hosts.
executing program
BUG: memory leak
unreferenced object 0xffff8881020ec480 (size 64):
comm "swapper/0", pid 1, jiffies 4294937719 (age 53.000s)
hex dump (first 32 bytes):
60 5d 7c 06 81 88 ff ff c0 17 65 04 81 88 ff ff `]|.......e.....
80 35 12 42 81 88 ff ff 80 35 12 42 81 88 ff ff .5.B.....5.B....
backtrace:
[<ffffffff82b09f12>] kmalloc include/linux/slab.h:556 [inline]
[<ffffffff82b09f12>] kzalloc include/linux/slab.h:686 [inline]
[<ffffffff82b09f12>] hwsim_alloc_edge.constprop.0+0x22/0x80 drivers/net/ieee802154/mac802154_hwsim.c:385
[<ffffffff82b0b0f3>] hwsim_subscribe_all_others drivers/net/ieee802154/mac802154_hwsim.c:709 [inline]
[<ffffffff82b0b0f3>] hwsim_add_one+0x3b3/0x640 drivers/net/ieee802154/mac802154_hwsim.c:802
[<ffffffff82b0b3c4>] hwsim_probe+0x44/0xd0 drivers/net/ieee802154/mac802154_hwsim.c:848
[<ffffffff82628bf1>] platform_probe+0x81/0x120 drivers/base/platform.c:1447
[<ffffffff82625679>] really_probe+0x159/0x500 drivers/base/dd.c:576
[<ffffffff82625aab>] driver_probe_device+0x8b/0x100 drivers/base/dd.c:763
[<ffffffff82626325>] device_driver_attach+0x105/0x110 drivers/base/dd.c:1039
[<ffffffff826263d1>] __driver_attach drivers/base/dd.c:1117 [inline]
[<ffffffff826263d1>] __driver_attach+0xa1/0x140 drivers/base/dd.c:1070
[<ffffffff82622459>] bus_for_each_dev+0xa9/0x100 drivers/base/bus.c:305
[<ffffffff826244e0>] bus_add_driver+0x160/0x280 drivers/base/bus.c:622
[<ffffffff82627233>] driver_register+0xc3/0x150 drivers/base/driver.c:171
[<ffffffff874fa3dc>] hwsim_init_module+0xae/0x107 drivers/net/ieee802154/mac802154_hwsim.c:899
[<ffffffff81001083>] do_one_initcall+0x63/0x2e0 init/main.c:1249
[<ffffffff87489873>] do_initcall_level init/main.c:1322 [inline]
[<ffffffff87489873>] do_initcalls init/main.c:1338 [inline]
[<ffffffff87489873>] do_basic_setup init/main.c:1358 [inline]
[<ffffffff87489873>] kernel_init_freeable+0x1f4/0x26e init/main.c:1560
[<ffffffff84359255>] kernel_init+0xc/0x1a7 init/main.c:1447
[<ffffffff810022ef>] ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294

BUG: memory leak
unreferenced object 0xffff8881046517c0 (size 32):
comm "swapper/0", pid 1, jiffies 4294937719 (age 53.000s)
hex dump (first 32 bytes):
ff 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:
[<ffffffff82b09f35>] kmalloc include/linux/slab.h:556 [inline]
[<ffffffff82b09f35>] kzalloc include/linux/slab.h:686 [inline]
[<ffffffff82b09f35>] hwsim_alloc_edge.constprop.0+0x45/0x80 drivers/net/ieee802154/mac802154_hwsim.c:389
[<ffffffff82b0b0f3>] hwsim_subscribe_all_others drivers/net/ieee802154/mac802154_hwsim.c:709 [inline]
[<ffffffff82b0b0f3>] hwsim_add_one+0x3b3/0x640 drivers/net/ieee802154/mac802154_hwsim.c:802
[<ffffffff82b0b3c4>] hwsim_probe+0x44/0xd0 drivers/net/ieee802154/mac802154_hwsim.c:848
[<ffffffff82628bf1>] platform_probe+0x81/0x120 drivers/base/platform.c:1447
[<ffffffff82625679>] really_probe+0x159/0x500 drivers/base/dd.c:576
[<ffffffff82625aab>] driver_probe_device+0x8b/0x100 drivers/base/dd.c:763
[<ffffffff82626325>] device_driver_attach+0x105/0x110 drivers/base/dd.c:1039
[<ffffffff826263d1>] __driver_attach drivers/base/dd.c:1117 [inline]
[<ffffffff826263d1>] __driver_attach+0xa1/0x140 drivers/base/dd.c:1070
[<ffffffff82622459>] bus_for_each_dev+0xa9/0x100 drivers/base/bus.c:305
[<ffffffff826244e0>] bus_add_driver+0x160/0x280 drivers/base/bus.c:622
[<ffffffff82627233>] driver_register+0xc3/0x150 drivers/base/driver.c:171
[<ffffffff874fa3dc>] hwsim_init_module+0xae/0x107 drivers/net/ieee802154/mac802154_hwsim.c:899
[<ffffffff81001083>] do_one_initcall+0x63/0x2e0 init/main.c:1249
[<ffffffff87489873>] do_initcall_level init/main.c:1322 [inline]
[<ffffffff87489873>] do_initcalls init/main.c:1338 [inline]
[<ffffffff87489873>] do_basic_setup init/main.c:1358 [inline]
[<ffffffff87489873>] kernel_init_freeable+0x1f4/0x26e init/main.c:1560
[<ffffffff84359255>] kernel_init+0xc/0x1a7 init/main.c:1447
[<ffffffff810022ef>] ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294



---
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,
Jun 14, 2021, 3:06:07 PM6/14/21
to chouhan.sh...@gmail.com, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
memory leak in hwsim_add_one

BUG: memory leak
unreferenced object 0xffff88810623e440 (size 64):
comm "swapper/0", pid 1, jiffies 4294937780 (age 82.050s)
hex dump (first 32 bytes):
60 35 2a 06 81 88 ff ff 80 08 6d 05 81 88 ff ff `5*.......m.....
80 a5 8f 40 81 88 ff ff 80 a5 8f 40 81 88 ff ff ...@.......@....
backtrace:
[<ffffffff82b09b62>] kmalloc include/linux/slab.h:556 [inline]
[<ffffffff82b09b62>] kzalloc include/linux/slab.h:686 [inline]
[<ffffffff82b09b62>] hwsim_alloc_edge.constprop.0+0x22/0x80 drivers/net/ieee802154/mac802154_hwsim.c:385
[<ffffffff82b0ad43>] hwsim_subscribe_all_others drivers/net/ieee802154/mac802154_hwsim.c:709 [inline]
[<ffffffff82b0ad43>] hwsim_add_one+0x3b3/0x640 drivers/net/ieee802154/mac802154_hwsim.c:802
[<ffffffff82b0b014>] hwsim_probe+0x44/0xd0 drivers/net/ieee802154/mac802154_hwsim.c:848
[<ffffffff82628861>] platform_probe+0x81/0x120 drivers/base/platform.c:1447
[<ffffffff826252e9>] really_probe+0x159/0x500 drivers/base/dd.c:576
[<ffffffff8262571b>] driver_probe_device+0x8b/0x100 drivers/base/dd.c:763
[<ffffffff82625f95>] device_driver_attach+0x105/0x110 drivers/base/dd.c:1039
[<ffffffff82626041>] __driver_attach drivers/base/dd.c:1117 [inline]
[<ffffffff82626041>] __driver_attach+0xa1/0x140 drivers/base/dd.c:1070
[<ffffffff826220c9>] bus_for_each_dev+0xa9/0x100 drivers/base/bus.c:305
[<ffffffff82624150>] bus_add_driver+0x160/0x280 drivers/base/bus.c:622
[<ffffffff82626ea3>] driver_register+0xc3/0x150 drivers/base/driver.c:171
[<ffffffff86cfa330>] hwsim_init_module+0xae/0x107 drivers/net/ieee802154/mac802154_hwsim.c:899
[<ffffffff81001083>] do_one_initcall+0x63/0x2e0 init/main.c:1249
[<ffffffff86c898e7>] do_initcall_level init/main.c:1322 [inline]
[<ffffffff86c898e7>] do_initcalls init/main.c:1338 [inline]
[<ffffffff86c898e7>] do_basic_setup init/main.c:1358 [inline]
[<ffffffff86c898e7>] kernel_init_freeable+0x268/0x2e2 init/main.c:1560
[<ffffffff843590e5>] kernel_init+0xc/0x1a7 init/main.c:1447
[<ffffffff810022ef>] ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294

BUG: memory leak
unreferenced object 0xffff8881056d0880 (size 32):
comm "swapper/0", pid 1, jiffies 4294937780 (age 82.050s)
hex dump (first 32 bytes):
ff 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:
[<ffffffff82b09b85>] kmalloc include/linux/slab.h:556 [inline]
[<ffffffff82b09b85>] kzalloc include/linux/slab.h:686 [inline]
[<ffffffff82b09b85>] hwsim_alloc_edge.constprop.0+0x45/0x80 drivers/net/ieee802154/mac802154_hwsim.c:389
[<ffffffff82b0ad43>] hwsim_subscribe_all_others drivers/net/ieee802154/mac802154_hwsim.c:709 [inline]
[<ffffffff82b0ad43>] hwsim_add_one+0x3b3/0x640 drivers/net/ieee802154/mac802154_hwsim.c:802
[<ffffffff82b0b014>] hwsim_probe+0x44/0xd0 drivers/net/ieee802154/mac802154_hwsim.c:848
[<ffffffff82628861>] platform_probe+0x81/0x120 drivers/base/platform.c:1447
[<ffffffff826252e9>] really_probe+0x159/0x500 drivers/base/dd.c:576
[<ffffffff8262571b>] driver_probe_device+0x8b/0x100 drivers/base/dd.c:763
[<ffffffff82625f95>] device_driver_attach+0x105/0x110 drivers/base/dd.c:1039
[<ffffffff82626041>] __driver_attach drivers/base/dd.c:1117 [inline]
[<ffffffff82626041>] __driver_attach+0xa1/0x140 drivers/base/dd.c:1070
[<ffffffff826220c9>] bus_for_each_dev+0xa9/0x100 drivers/base/bus.c:305
[<ffffffff82624150>] bus_add_driver+0x160/0x280 drivers/base/bus.c:622
[<ffffffff82626ea3>] driver_register+0xc3/0x150 drivers/base/driver.c:171
[<ffffffff86cfa330>] hwsim_init_module+0xae/0x107 drivers/net/ieee802154/mac802154_hwsim.c:899
[<ffffffff81001083>] do_one_initcall+0x63/0x2e0 init/main.c:1249
[<ffffffff86c898e7>] do_initcall_level init/main.c:1322 [inline]
[<ffffffff86c898e7>] do_initcalls init/main.c:1338 [inline]
[<ffffffff86c898e7>] do_basic_setup init/main.c:1358 [inline]
[<ffffffff86c898e7>] kernel_init_freeable+0x268/0x2e2 init/main.c:1560
[<ffffffff843590e5>] kernel_init+0xc/0x1a7 init/main.c:1447
[<ffffffff810022ef>] ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294



Tested on:

commit: 009c9aa5 Linux 5.13-rc6
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=13d91468300000
kernel config: https://syzkaller.appspot.com/x/.config?x=f0feb13c366096e5
dashboard link: https://syzkaller.appspot.com/bug?extid=b80c9959009a9325cdff
compiler:

syzbot

unread,
Jun 15, 2021, 6:30:08 AM6/15/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+b80c99...@syzkaller.appspotmail.com

Tested on:

commit: 009c9aa5 Linux 5.13-rc6
git tree: upstream
patch: https://syzkaller.appspot.com/x/patch.diff?x=1024a5bbd00000

Note: testing is done by a robot and is best-effort only.
Reply all
Reply to author
Forward
0 new messages