From: Jason Gunthorpe <jgg@ziepe.ca>
To: syzbot <syzbot+17fb1664c4f5a2eeb36f@syzkaller.appspotmail.com>
Cc: leon@kernel.org, linux-kernel@vger.kernel.org,
linux-rdma@vger.kernel.org, netdev@vger.kernel.org,
syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [rdma?] KASAN: slab-use-after-free Read in ib_device_uevent (2)
Date: Wed, 19 Mar 2025 20:49:12 -0300 [thread overview]
Message-ID: <20250319234912.GH126678@ziepe.ca> (raw)
In-Reply-To: <67b25ec8.050a0220.54b41.000d.GAE@google.com>
On Sun, Feb 16, 2025 at 01:55:20PM -0800, syzbot wrote:
> CPU: 1 UID: 0 PID: 6903 Comm: udevd Not tainted 6.14.0-rc2-syzkaller-00039-g09fbf3d50205 #0
> Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
> Call Trace:
> add_uevent_var+0x17c/0x3a0 lib/kobject_uevent.c:679
> ib_device_uevent+0x4e/0xb0 drivers/infiniband/core/device.c:502
> dev_uevent+0x28b/0x770 drivers/base/core.c:2673
>
> Allocated by task 12483:
> kvasprintf_const+0x164/0x1a0 lib/kasprintf.c:46
> kobject_set_name_vargs+0x5a/0x140 lib/kobject.c:274
> dev_set_name+0xc8/0x100 drivers/base/core.c:3468
> assign_name drivers/infiniband/core/device.c:1202 [inline]
> ib_register_device+0x7e0/0xdf0 drivers/infiniband/core/device.c:1384
> siw_device_register drivers/infiniband/sw/siw/siw_main.c:72 [inline]
> Freed by task 12485:
> kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
> kasan_save_track+0x14/0x30 mm/kasan/common.c:68
> kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:576
> poison_slab_object mm/kasan/common.c:247 [inline]
> __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264
> kasan_slab_free include/linux/kasan.h:233 [inline]
> slab_free_hook mm/slub.c:2353 [inline]
> slab_free mm/slub.c:4609 [inline]
> kfree+0x2c4/0x4d0 mm/slub.c:4757
> kfree_const+0x55/0x60 mm/util.c:43
> kobject_rename+0x179/0x260 lib/kobject.c:524
> device_rename+0x130/0x230 drivers/base/core.c:4525
> ib_device_rename+0x114/0x5c0 drivers/infiniband/core/device.c:402
This looks like it is racing siw_device_register() with
ib_device_rename() ??
Whichi suggests we don't have the right protection in
ib_device_rename() to not act on devices that are yet to be fully
registered.
Jason
next prev parent reply other threads:[~2025-03-19 23:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-16 21:55 syzbot
2025-03-19 23:49 ` Jason Gunthorpe [this message]
2025-03-20 8:41 ` Zhu Yanjun
2025-03-20 15:45 ` Bernard Metzler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250319234912.GH126678@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=syzbot+17fb1664c4f5a2eeb36f@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®