lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2025082029-december-backroom-ef5a@gregkh>
Date: Wed, 20 Aug 2025 16:23:44 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: zhoumin <teczm@...mail.com>
Cc: akpm@...ux-foundation.org, dakr@...nel.org,
	linux-kernel@...r.kernel.org, rafael@...nel.org
Subject: Re: [RFC PATCH] kobject: fix uevent helper execution order issues

On Wed, Aug 20, 2025 at 10:04:26PM +0800, zhoumin wrote:
> Hi Greg
> 
> Thanks for your patience.
> 
> > Why are you not looking at the SEQNUM value?  That should be what orders
> > the events, right?  Otherwise how would any of this work?  :)
> 
> > Also, what usermode helper program are you using that requires a binary?
> > What is wrong with udev?
> 
> Due to historical reasons, our system does not use udev and relies entirely
> on custom shell scripts to handle kobject events.

Given that udev is older than any other "historical reason" that feels
very odd.  udev was created at the same exact time the uevent api was
added, it's over 20 years old now.

> The helper_lock and UMH_WAIT_EXEC in the kernel ensure that the uevent
> helper serializes the execution of our shell scripts. That is why I
> proposed the RFC patch to change UMH_NO_WAIT to UMH_WAIT_EXEC—for our use
> case, this change provides clear benefits without downsides, aslo it avoids
> blocking like UMH_WAIT_PROC while improving script execution order.

But it does not guarantee what you are saying the real problem is here,
out-of-order events.

> Regarding SEQNUM: using it would require parsing and tracking global
> sequence numbers manually. In contrast, using a file lock would allow me to
> focus only on serializing events for the same kobject, since events from
> different objects don’t require synchronization.

SEQNUM is there for this very reason, to ignore it is wrong, and broken.
This is how the uevent system was designed to work.  Please fix your
userspace implementation, do not attempt to paper over the race in the
kernel, because as you say, it's not going to really solve it, only
reduce it.

And you will find that events from different objects WILL require
synchronization in many places, to ignore that is just going to cause
you even more problems.

> If you believe this patch isn’t suitable for mainline, I’m open to
> implementing a SEQNUM-based approach for better event ordering instead.

Please do so.  Even better yet, use udev!  Or mdev.  or one of the other
very old uevent handlers out there, you have plenty to choose from.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ