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: <ZxapYkZAgxXBTJsb@google.com>
Date: Mon, 21 Oct 2024 12:20:02 -0700
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Colin Ian King <colin.i.king@...il.com>
Cc: linux-input@...r.kernel.org, kernel-janitors@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH][next] Input: serio_raw: Fix uninitialized variable
 'written'

Hi Colin,

On Mon, Oct 21, 2024 at 03:41:03PM +0100, Colin Ian King wrote:
> The variable written is not initialized and subsequent increments of the
> variable are using an uninitialized value. Fix this by initializating it
> at the start of the function.

Thank you for the patch but I already have one fixing this up queued.

> 
> Fixes: 5b53a9d40c4f ("Input: serio_raw - use guard notation for locks and other resources")
> Signed-off-by: Colin Ian King <colin.i.king@...il.com>
> ---
>  drivers/input/serio/serio_raw.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c
> index e058fef07f57..4d6395088986 100644
> --- a/drivers/input/serio/serio_raw.c
> +++ b/drivers/input/serio/serio_raw.c
> @@ -185,7 +185,7 @@ static ssize_t serio_raw_write(struct file *file, const char __user *buffer,
>  {
>  	struct serio_raw_client *client = file->private_data;
>  	struct serio_raw *serio_raw = client->serio_raw;
> -	int written;
> +	int written = 0;
>  	unsigned char c;
>  
>  	scoped_guard(mutex_intr, &serio_raw_mutex) {
> -- 
> 2.39.5
> 

-- 
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ