[<prev] [next>] [day] [month] [year] [list]
Message-ID: <692fe737.a70a0220.2ea503.00cd.GAE@google.com>
Date: Tue, 02 Dec 2025 23:31:03 -0800
From: syzbot <syzbot+b63d677d63bcac06cf90@...kaller.appspotmail.com>
To: lanbincn@...mail.com
Cc: lanbincn@...mail.com, linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [PATCH 6.1.y] HID: core: Harden s32ton() against conversion to 0 bits
> #syz test:
This bug is already marked as fixed. No point in testing.
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git linux-6.1.y
>
> drivers/hid/hid-core.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> index ed65523d77c2..c8cca0c7ec67 100644
> --- a/drivers/hid/hid-core.c
> +++ b/drivers/hid/hid-core.c
> @@ -1354,7 +1354,12 @@ EXPORT_SYMBOL_GPL(hid_snto32);
>
> static u32 s32ton(__s32 value, unsigned n)
> {
> - s32 a = value >> (n - 1);
> + s32 a;
> + if (!value || !n)
> + return 0;
> +
> + a = value >> (n - 1);
> +
> if (a && a != -1)
> return value < 0 ? 1 << (n - 1) : (1 << (n - 1)) - 1;
> return value & ((1 << n) - 1);
> --
> 2.43.0
>
>
Powered by blists - more mailing lists