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: <20250216135748.GD1615191@kernel.org>
Date: Sun, 16 Feb 2025 13:57:48 +0000
From: Simon Horman <horms@...nel.org>
To: Peter Seiderer <ps.report@....net>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-kselftest@...r.kernel.org,
	"David S . Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Shuah Khan <shuah@...nel.org>, Thomas Gleixner <tglx@...utronix.de>,
	Artem Chernyshev <artem.chernyshev@...-soft.ru>,
	Nam Cao <namcao@...utronix.de>,
	Frederic Weisbecker <frederic@...nel.org>
Subject: Re: [PATCH net-next v5 1/8] net: pktgen: fix mix of int/long

On Thu, Feb 13, 2025 at 12:19:13PM +0100, Peter Seiderer wrote:
> Fix mix of int/long (and multiple conversion from/to) by using consequently
> size_t for i and max and ssize_t for len and adjust function signatures
> of hex32_arg(), count_trail_chars(), num_arg() and strn_len() accordingly.
> 
> Signed-off-by: Peter Seiderer <ps.report@....net>
> ---
> Changes v4 -> v5
>   - split up patchset into part i/ii (suggested by Simon Horman)
>   - instead of align to most common pattern (int) adjust all usages to
>     size_t for i and max and ssize_t for len and adjust function signatures
>     of hex32_arg(), count_trail_chars(), num_arg() and strn_len() accordingly
>   - respect reverse xmas tree order for local variable declarations (where
>     possible without too much code churn)
>   - update subject line and patch description
>   - fix checkpatch warning '"foo * bar" should be "foo *bar"' for
>     count_trail_chars() and strn_len()
> 
> Changes v3 -> v4
>   - new patch (factored out of patch 'net: pktgen: fix access outside of user
>     given buffer in pktgen_if_write()')

Thanks Peter,

A minor nit below, but this looks good to me.

Reviewed-by: Simon Horman <horms@...nel.org>

...

> @@ -777,10 +778,10 @@ static int hex32_arg(const char __user *user_buffer, unsigned long maxlen,
>  	return i;
>  }
>  
> -static int count_trail_chars(const char __user * user_buffer,
> -			     unsigned int maxlen)
> +static ssize_t count_trail_chars(const char __user *user_buffer,
> +				 size_t maxlen)

nit. as there will be a v2 anyway: the above can fit on one line.

>  {
> -	int i;
> +	size_t i;
>  
>  	for (i = 0; i < maxlen; i++) {
>  		char c;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ