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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aIn8fDpGz7MCACQ3@quatroqueijos.cascardo.eti.br>
Date: Wed, 30 Jul 2025 08:05:32 -0300
From: Thadeu Lima de Souza Cascardo <cascardo@...lia.com>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Arnd Bergmann <arnd@...db.de>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Dirk VanDerMerwe <dirk.vandermerwe@...hos.com>,
	Vimal Agrawal <vimal.agrawal@...hos.com>,
	linux-kernel@...r.kernel.org, kernel-dev@...lia.com,
	"open list:KERNEL SELFTEST FRAMEWORK" <linux-kselftest@...r.kernel.org>,
	KUnit Development <kunit-dev@...glegroups.com>
Subject: Re: [PATCH v5] char: misc: add test cases

On Wed, Jul 30, 2025 at 09:08:57AM +0200, Geert Uytterhoeven wrote:
> Hi Thadeu,,
> 
> On Sun, 15 Jun 2025 at 23:31, Thadeu Lima de Souza Cascardo
> <cascardo@...lia.com> wrote:
> >
> > Add test cases for static and dynamic minor number allocation and
> > deallocation.
> >
> > While at it, improve description and test suite name.
> >
> > Some of the cases include:
> >
> > - that static and dynamic allocation reserved the expected minors.
> >
> > - that registering duplicate minors or duplicate names will fail.
> >
> > - that failing to create a sysfs file (due to duplicate names) will
> >   deallocate the dynamic minor correctly.
> >
> > - that dynamic allocation does not allocate a minor number in the static
> >   range.
> >
> > - that there are no collisions when mixing dynamic and static allocations.
> >
> > - that opening devices with various minor device numbers work.
> >
> > - that registering a static number in the dynamic range won't conflict with
> >   a dynamic allocation.
> >
> > This last test verifies the bug fixed by commit 6d04d2b554b1 ("misc:
> > misc_minor_alloc to use ida for all dynamic/misc dynamic minors") has not
> > regressed.
> >
> > Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@...lia.com>
> 
> Thanks for your patch, which is now commit 74d8361be3441dff ("char:
> misc: add test cases") in linus/master stable/master
> 
> > Changes in v5:
> > - Make miscdevice unit test built-in only
> > - Make unit test require CONFIG_KUNIT=y
> 
> Why were these changes made? This means the test is no longer available
> if KUNIT=m, and I can no longer just load the module when I want to
> run the test.
> 

These were made because a bug was found that devices with minor > 255 could
not be opened. So I added a test for that, which used __init functions, so
the test now had to be built-in. The alternative is to make these functions
not __init anymore and export them. Those functions are init_mknod and
init_unlink.

I will see if I can cook an RFC later today.

Cascardo.

> > - Link to v4: https://lore.kernel.org/r/20250423-misc-dynrange-v4-0-133b5ae4ca18@igalia.com
> 
> > --- a/lib/Kconfig.debug
> > +++ b/lib/Kconfig.debug
> > @@ -2506,8 +2506,8 @@ config TEST_IDA
> >         tristate "Perform selftest on IDA functions"
> >
> >  config TEST_MISC_MINOR
> > -       tristate "miscdevice KUnit test" if !KUNIT_ALL_TESTS
> > -       depends on KUNIT
> > +       bool "miscdevice KUnit test" if !KUNIT_ALL_TESTS
> > +       depends on KUNIT=y
> >         default KUNIT_ALL_TESTS
> >         help
> >           Kunit test for miscdevice API, specially its behavior in respect to
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> -- 
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ