Re: [PATCH] kobject: avoid blocking allocation while holding uevent_sock_mutex

From: Greg KH

Date: Wed Aug 26 2026 - 03:31:07 EST


A: http://en.wikipedia.org/wiki/Top_post
Q: Were do I find info about this thing called top-posting?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

A: No.
Q: Should I include quotations after my reply?

http://daringfireball.net/2007/07/on_top

On Wed, Aug 26, 2026 at 03:17:58PM +0800, Tao Yu wrote:
> Hi Greg,
>
> Thanks for the review.
>
> Nothing changed in USB enumeration itself. What syzbot appears to be
> hitting is a long-standing latency problem in the untagged uevent path,
> not a recent USB-specific regression.
>
> The blocked task is in:
>
> usb_set_configuration()
> -> device_add()
> -> kobject_uevent_env()
> -> uevent_net_broadcast_untagged()
>
> so the contention point is the global untagged-uevent broadcast path in
> lib/kobject_uevent.c.
>
> Looking at the history, the locked allocation/broadcast pattern appears
> to date back to 16dff336b33d ("kobject: add kobject_uevent_net_broadcast()").
> Because of that, I did not add a Fixes tag or cc stable in v1. I do not
> have evidence that this is a recent regression, so I would rather not
> add those tags without a stronger justification.

But if this is something that userspace can trigger, as syzbot is
showing, then it should be backported to resolve the problem for people
hitting it like yourself.

> You are also right about the race in my listener pre-check. A listener
> can appear after the first unlock, so that part of v1 is not correct.
> I will drop that approach in the next revision.
>
> I also should have included the syzbot link and testing details. The
> report is here:
> https://syzkaller.appspot.com/bug?extid=c22bb42560ec86726aba
>
> syzbot has now tested the proposed patch and reported that the
> reproducer did not trigger the issue:
> https://groups.google.com/g/syzkaller-bugs/c/q6wmyA-hG6E/m/rLDsbLC-AQAJ
>
> So the patch now has:
> Tested-by: syzbot+c22bb42560ec86726aba@xxxxxxxxxxxxxxxxxxxxxxxxx
>
> I also compile-tested it with:
> make lib/kobject_uevent.o

But that doesn't actually test things locally. Please do so on your own
machine as obviously this is a path you can validate yourself.

thanks,

greg k-hh