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: <2025062445-procedure-latch-9421@gregkh>
Date: Tue, 24 Jun 2025 16:50:30 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Zijun Hu <zijun_hu@...oud.com>
Cc: Arnd Bergmann <arnd@...db.de>, linux-kernel@...r.kernel.org,
	Zijun Hu <zijun.hu@....qualcomm.com>
Subject: Re: [PATCH RFC] char: misc: Enforce simple minor space division

On Fri, Jun 20, 2025 at 10:53:32PM +0800, Zijun Hu wrote:
> From: Zijun Hu <zijun.hu@....qualcomm.com>
> 
> Enforce simple minor space division related to macro MISC_DYNAMIC_MINOR
> defined as 255 currently:
> 
> <  255 : Fixed minor codes
> == 255 : Indicator to request dynamic minor code
> >  255 : Dynamic minor codes requested

Is this the rule today?  If so, does the now-added tests we have for
misc device properly test for this?

> This enforcing division also solves misc_register() reentry issue below:
> 
> // Suppose both static @dev_A and @dev_B want to request dynamic minors.
> @dev_A.minor(255) @dev_B.minor(255)
> 
> // Register @dev_A then de-register it.
> @dev_A.minor(255) -> registered -> @dev_A.minor(500) -> de-registered
> -> @dev_A.minor(500)
> 
> // Register @dev_B
> @dev_B.minor(255) -> registered -> @dev_B.minor(500)
> 
> // Register @dev_A again
> @dev_A.minor(500) -> encounter -EBUSY error since @dev_B has got 500.

Does this ever really happen?

And with the recent changes in the last dev cycle in this code area, is
it still an issue?

> Side effects:
> It will be refused to register device whose fixed minor > 255.

Do we have any in-kernel users that are > 255?

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ