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]
Date:   Tue, 12 Jul 2022 15:35:00 -0700
From:   Dmitry Torokhov <dmitry.torokhov@...il.com>
To:     Guenter Roeck <linux@...ck-us.net>
Cc:     Jiri Kosina <jikos@...nel.org>,
        Benjamin Tissoires <benjamin.tissoires@...hat.com>,
        linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
        Nergi Rahardi <nergi@...gle.com>,
        "Daniel J . Ogorchock" <djogorchock@...il.com>
Subject: Re: [PATCH] HID: nintendo: Add missing array termination

On Tue, Jul 12, 2022 at 03:17:05PM -0700, Guenter Roeck wrote:
> joycon_dpad_inputs_jc[] is unterminated. This may result in odd warnings
> such as
> 
> input: input_set_capability: invalid code 3077588140 for type 1
> 
> or in kernel crashes in nintendo_hid_probe(). Terminate the array to fix
> the problem.
> 
> Fixes: 2af16c1f846bd ("HID: nintendo: add nintendo switch controller driver")
> Cc: Daniel J. Ogorchock <djogorchock@...il.com>
> Signed-off-by: Guenter Roeck <linux@...ck-us.net>

Reviewed-by: Dmitry Torokhov <dmitry.torokhov@...il.com>

I'd recommend tagging stable on this one.

> ---
>  drivers/hid/hid-nintendo.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
> index 2204de889739..4b1173957c17 100644
> --- a/drivers/hid/hid-nintendo.c
> +++ b/drivers/hid/hid-nintendo.c
> @@ -1586,6 +1586,7 @@ static const unsigned int joycon_button_inputs_r[] = {
>  /* We report joy-con d-pad inputs as buttons and pro controller as a hat. */
>  static const unsigned int joycon_dpad_inputs_jc[] = {
>  	BTN_DPAD_UP, BTN_DPAD_DOWN, BTN_DPAD_LEFT, BTN_DPAD_RIGHT,
> +	0 /* 0 signals end of array */
>  };
>  
>  static int joycon_input_create(struct joycon_ctlr *ctlr)
> -- 
> 2.35.1
> 

Thanks.

-- 
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ