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] [thread-next>] [day] [month] [year] [list]
Message-ID: <2025022023-fragile-moonstone-3419@gregkh>
Date: Thu, 20 Feb 2025 15:32:15 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Thadeu Lima de Souza Cascardo <cascardo@...lia.com>
Cc: linux-kernel@...r.kernel.org, Arnd Bergmann <arnd@...db.de>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Dirk VanDerMerwe <dirk.vandermerwe@...hos.com>,
	Vimal Agrawal <vimal.agrawal@...hos.com>, kernel-dev@...lia.com
Subject: Re: [PATCH 2/4] char: misc: add test cases

On Thu, Jan 23, 2025 at 09:32:47AM -0300, Thadeu Lima de Souza Cascardo 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 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>
> ---
>  drivers/misc/misc_minor_kunit.c | 515 +++++++++++++++++++++++++++++++-
>  1 file changed, 513 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/misc/misc_minor_kunit.c b/drivers/misc/misc_minor_kunit.c
> index 293e0fb7e43e..84e13bc5c61c 100644
> --- a/drivers/misc/misc_minor_kunit.c
> +++ b/drivers/misc/misc_minor_kunit.c
> @@ -51,19 +51,530 @@ static void kunit_misc_dynamic_minor(struct kunit *test)
>  	misc_deregister(&dev_misc_dynamic_minor);
>  }
>  
> +struct miscdev_test_case {
> +	const char *str;
> +	int minor;
> +};
> +
> +static struct miscdev_test_case miscdev_test_ranges[] = {
> +	{
> +		.str = "lower static range, top",
> +		.minor = 15,

As I don't agree with the previous patch, I'll not apply this one.

How about at least just redoing this one and using the values that the
code currently allocates?

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ