syzbot


memory leak in kobject_set_name_vargs

Status: fixed on 2019/07/10 21:40
Reported-by: syzbot+7fddca22578bc67c3fe4@syzkaller.appspotmail.com
Fix commit: 4f488fbca2a8 cfg80211: fix memory leak of wiphy device name
First crash: 1281d, last: 1247d
similar bugs (4):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream memory leak in kobject_set_name_vargs (3) C 19 744d 800d 17/24 fixed on 2020/11/16 12:12
upstream memory leak in kobject_set_name_vargs (5) C 4 58d 160d 23/24 upstream: reported C repro on 2022/06/22 23:13
upstream memory leak in kobject_set_name_vargs (2) C done 47 1041d 1225d 16/24 fixed on 2020/02/18 14:31
upstream memory leak in kobject_set_name_vargs (4) C 171 453d 740d 22/24 fixed on 2021/11/10 00:51

Sample crash report:
BUG: memory leak
unreferenced object 0xffff8881189e20a0 (size 32):
  comm "syz-executor763", pid 6993, jiffies 4294943151 (age 8.350s)
  hex dump (first 32 bytes):
    62 6f 6e 64 30 00 00 00 00 00 00 00 00 00 00 00  bond0...........
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<00000000856cc2c7>] kmemleak_alloc_recursive include/linux/kmemleak.h:43 [inline]
    [<00000000856cc2c7>] slab_post_alloc_hook mm/slab.h:439 [inline]
    [<00000000856cc2c7>] slab_alloc mm/slab.c:3326 [inline]
    [<00000000856cc2c7>] __do_kmalloc mm/slab.c:3658 [inline]
    [<00000000856cc2c7>] __kmalloc_track_caller+0x15d/0x2c0 mm/slab.c:3675
    [<00000000d3ea9156>] kstrdup+0x3a/0x70 mm/util.c:52
    [<00000000b8644a57>] kstrdup_const+0x48/0x60 mm/util.c:74
    [<00000000335051c2>] kvasprintf_const+0x7e/0xe0 lib/kasprintf.c:48
    [<000000002b24d8b6>] kobject_set_name_vargs+0x40/0xe0 lib/kobject.c:289
    [<00000000b6a73548>] dev_set_name+0x63/0x90 drivers/base/core.c:1915
    [<000000003ffaab43>] netdev_register_kobject+0x5a/0x1b0 net/core/net-sysfs.c:1727
    [<000000006fa8690c>] register_netdevice+0x397/0x600 net/core/dev.c:8733
    [<00000000d91c4b17>] bond_newlink drivers/net/bonding/bond_netlink.c:449 [inline]
    [<00000000d91c4b17>] bond_newlink+0x41/0x80 drivers/net/bonding/bond_netlink.c:439
    [<00000000b811933f>] __rtnl_newlink+0x892/0xb30 net/core/rtnetlink.c:3187
    [<00000000b75b8ba8>] rtnl_newlink+0x4e/0x80 net/core/rtnetlink.c:3245
    [<00000000b2551c97>] rtnetlink_rcv_msg+0x178/0x4b0 net/core/rtnetlink.c:5214
    [<000000003ef80388>] netlink_rcv_skb+0x61/0x170 net/netlink/af_netlink.c:2482
    [<000000000e4a4779>] rtnetlink_rcv+0x1d/0x30 net/core/rtnetlink.c:5232
    [<000000007e424066>] netlink_unicast_kernel net/netlink/af_netlink.c:1307 [inline]
    [<000000007e424066>] netlink_unicast+0x1ec/0x2d0 net/netlink/af_netlink.c:1333
    [<0000000025d14354>] netlink_sendmsg+0x26a/0x480 net/netlink/af_netlink.c:1922


Crashes (12):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-gce-leak 2019/07/02 06:31 upstream 6fbc7275c7a9 cccc4302 .config log report syz C
ci-upstream-gce-leak 2019/06/29 12:02 upstream 556e2f6020bf 7509bf36 .config log report syz C
ci-upstream-gce-leak 2019/06/28 02:15 upstream 249155c20f9b 7509bf36 .config log report syz C
ci-upstream-gce-leak 2019/06/27 16:19 upstream 249155c20f9b 7509bf36 .config log report syz C
ci-upstream-gce-leak 2019/06/24 11:40 upstream 241e39004581 472f0082 .config log report syz C
ci-upstream-gce-leak 2019/06/21 21:38 upstream abf02e2964b3 34bf9440 .config log report syz C
ci-upstream-gce-leak 2019/06/21 12:30 upstream abf02e2964b3 34bf9440 .config log report syz C
ci-upstream-gce-leak 2019/06/15 17:58 upstream 0011572c8830 442206d7 .config log report syz C
ci-upstream-gce-leak 2019/06/10 10:40 upstream d1fdb6d8f6a4 0159583c .config log report syz C
ci-upstream-gce-leak 2019/06/05 20:36 upstream 788a024921c4 bfb4a51e .config log report syz C
ci-upstream-gce-leak 2019/06/02 03:28 upstream 3ab4436f688c 53c81ea5 .config log report syz C
ci-upstream-gce-leak 2019/05/29 11:06 upstream 9fb67d643f6f 6bd61501 .config log report syz C
* Struck through repros no longer work on HEAD.