From: Hillf Danton <hdanton@sina.com>
To: syzbot <syzbot+a6ffe86390c8a6afc818@syzkaller.appspotmail.com>
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [rdma?] KASAN: slab-use-after-free Read in ucma_create_uevent
Date: Wed, 9 Jul 2025 10:06:09 +0800 [thread overview]
Message-ID: <20250709020610.3080-1-hdanton@sina.com> (raw)
In-Reply-To: <686db3ea.050a0220.1ffab7.0028.GAE@google.com>
> Date: Tue, 08 Jul 2025 17:12:26 -0700 [thread overview]
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: d006330be3f7 Merge tag 'sound-6.16-rc6' of git://git.kerne..
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=13e4bf70580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=8fa6c6703a4b2315
> dashboard link: https://syzkaller.appspot.com/bug?extid=a6ffe86390c8a6afc818
> compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17e4bf70580000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14f6ca8c580000
#syz test
--- x/drivers/infiniband/core/ucma.c
+++ y/drivers/infiniband/core/ucma.c
@@ -272,8 +272,24 @@ static struct ucma_event *ucma_create_ue
case RDMA_CM_EVENT_MULTICAST_ERROR:
uevent->mc = (struct ucma_multicast *)
event->param.ud.private_data;
- uevent->resp.uid = uevent->mc->uid;
- uevent->resp.id = uevent->mc->id;
+ do {
+ struct ucma_multicast *mc;
+ int err = 1;
+
+ xa_lock(&multicast_table);
+ list_for_each_entry(mc, &ctx->mc_list, list)
+ if (mc == uevent->mc) {
+ uevent->resp.uid = uevent->mc->uid;
+ uevent->resp.id = uevent->mc->id;
+ err = 0;
+ break;
+ }
+ xa_unlock(&multicast_table);
+ if (err) {
+ kfree(uevent);
+ return NULL;
+ }
+ } while (0);
break;
default:
uevent->resp.uid = ctx->uid;
--
next prev parent reply other threads:[~2025-07-09 2:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-09 0:12 syzbot
2025-07-09 2:06 ` Hillf Danton [this message]
2025-07-09 2:57 ` syzbot
2025-07-09 2:22 ` Edward Adam Davis
2025-07-09 3:08 ` syzbot
2025-07-10 2:12 ` syzbot
2025-07-25 7:47 ` Forwarded: " syzbot
2025-07-26 1:36 ` Edward Adam Davis
2025-07-26 1:50 ` syzbot
[not found] <20250710021243.1547487-1-lizhi.xu@windriver.com>
2025-07-10 2:31 ` syzbot
[not found] <20250725074710.1498616-1-lizhi.xu@windriver.com>
2025-07-25 8:00 ` syzbot
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=20250709020610.3080-1-hdanton@sina.com \
--to=hdanton@sina.com \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+a6ffe86390c8a6afc818@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®