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] [thread-next>] [day] [month] [year] [list]
Message-ID: <aXIOJEqV_ctVRrok@smile.fi.intel.com>
Date: Thu, 22 Jan 2026 13:46:44 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Dmitry Antipov <dmantipov@...dex.ru>
Cc: Andrew Morton <akpm@...ux-foundation.org>, Kees Cook <kees@...nel.org>,
	"Darrick J . Wong" <djwong@...nel.org>,
	linux-hardening@...r.kernel.org
Subject: Re: [PATCH 1/2] lib/cmdline_kunit: add test case for memparse()

On Thu, Jan 22, 2026 at 02:12:53PM +0300, Dmitry Antipov wrote:
> Better late than never, now there is a long-awaited basic
> test for 'memparse()' which is provided by cmdline.c.

Thank you for this! Really appreciate!

See a couple of nit-picks below.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@...el.com>
assuming they will be amended.

...

> +static const struct cmdline_test_memparse_entry testdata[] = {
> +	{ "0",			"",	0ULL },
> +	{ "1",			"",	1ULL },
> +	{ "a",			"a",	0ULL },
> +	{ "0xb",		"",	11ULL },
> +	{ "0xz",		"x",	0ULL },
> +	{ "1234",		"",	1234ULL },
> +	{ "04567",		"",	2423ULL },
> +	{ "0x9876",		"",	39030LL },
> +	{ "05678",		"8",	375ULL },
> +	{ "0xabcdefz",		"z",	11259375ULL },
> +	{ "0cdba",		"c",	0ULL },

> +	{ "4K",			"",	4096ULL },
> +	{ "0x10k@...aaabbbb",	"@",	16384ULL },
> +	{ "32M",		"",	33554432ULL },

These can utilize constants from sizes.h.

> +	{ "067m:foo",		":",	57671680ULL },

> +	{ "2G;bar=baz",		";",	2147483648ULL },

Ditto.

> +	{ "07gz",		"z",	7516192768ULL },
> +	{ "3T+data",		"+",	3298534883328ULL },

> +	{ "04t,ro",		",",	4398046511104ULL },

Ditto. (However I don't remember the maximum available there.)

> +	{ "012p",		"",	11258999068426240ULL },
> +	{ "7P,sync",		",",	7881299347898368ULL },
> +	{ "0x2e",		"",	46ULL },
> +	{ "2E and more",	" ",	2305843009213693952ULL },
> +	{ "18446744073709551615", "",	18446744073709551615ULL },

> +	{ "18446744073709551616", "",	0ULL }

Leave trailing comma as it's not a terminator.

Can we also have one with more than 20 decimal digits?

> +};

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ