From: Vicki Pfau <vi@endrift.com>
To: Jiri Kosina <jikos@kernel.org>, Pei Xiao <xiaopei01@kylinos.cn>
Cc: Benjamin Tissoires <bentiss@kernel.org>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
syzbot+75f3f9bff8c510602d36@syzkaller.appspotmail.com,
syzkaller-bugs@googlegroups.com
Subject: Re: [PATCH] HID: hid-steam: fix uninit-value access in steam_get_serial
Date: Mon, 3 Aug 2026 13:39:35 -0700 [thread overview]
Message-ID: <5ad5f7d4-a29f-409a-8153-c162059807b2@endrift.com> (raw)
In-Reply-To: <85n82qo4-q3q8-8052-1qnr-n7qo12p2p01n@xreary.bet>
Hi Jiri,
On 8/3/26 12:34 PM, Jiri Kosina wrote:
> CCing Vicki Pfau here ... could you please give your Ack to this fix?
This was already fixed in 9f8ee99f831b2711624ef81d0abba1d183f28b09 in the series I submitted earlier. I didn't realize there was an open bug report for it.
>
> Thanks.
>
> On Wed, 10 Jun 2026, Pei Xiao wrote:
>
>> The reply buffer in steam_get_serial() is allocated on the stack without
>> initialization. In cases where steam_recv_report() returns a short read or
>> an error, not all bytes of the buffer are written, leading to subsequent
>> access of uninitialized memory when checking reply[0], reply[1], reply[2].
>>
>> Zero-initialize the reply array to prevent KMSAN uninit-value warnings.
>>
>> Logs:
>> hid-steam 0003:28DE:1102.0007: unknown main item tag 0x0
>> hid-steam 0003:28DE:1102.0007: unknown main item tag 0x0
>> hid-steam 0003:28DE:1102.0007: :
>> USB HID v7f.fd Device [HID 28de:1102] on usb-dummy_hcd.1-1/input0
>> =====================================================
>> BUG: KMSAN: uninit-value in steam_get_serial drivers/hid/hid-steam.c:457 [inline]
>> BUG: KMSAN: uninit-value in steam_register+0xd83/0x10e0 drivers/hid/hid-steam.c:965
>> steam_get_serial drivers/hid/hid-steam.c:457 [inline]
>> steam_register+0xd83/0x10e0 drivers/hid/hid-steam.c:965
>> steam_probe+0x6f1/0x19b0 drivers/hid/hid-steam.c:1273
>> __hid_device_probe drivers/hid/hid-core.c:2822 [inline]
>> hid_device_probe+0x60d/0xb90 drivers/hid/hid-core.c:2859
>> call_driver_probe drivers/base/dd.c:-1 [inline]
>> really_probe+0x4d5/0xe40 drivers/base/dd.c:709
>> ...
>>
>> Local variable reply.i created at:
>> steam_get_serial drivers/hid/hid-steam.c:448 [inline]
>> steam_register+0x180/0x10e0 drivers/hid/hid-steam.c:965
>> steam_probe+0x6f1/0x19b0 drivers/hid/hid-steam.c:1273
>>
>> Reported-by: syzbot+75f3f9bff8c510602d36@syzkaller.appspotmail.com
>> Closes: https://lore.kernel.org/lkml/6a27d055.39669fcc.33b062.008d.GAE@google.com/
>> Fixes: c164d6abf384 ("HID: add driver for Valve Steam Controller")
>> Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
>
>
>
>> ---
>> drivers/hid/hid-steam.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/hid/hid-steam.c b/drivers/hid/hid-steam.c
>> index 197126d6e081..f65ad1a21c01 100644
>> --- a/drivers/hid/hid-steam.c
>> +++ b/drivers/hid/hid-steam.c
>> @@ -445,7 +445,7 @@ static int steam_get_serial(struct steam_device *steam)
>> */
>> int ret = 0;
>> u8 cmd[] = {ID_GET_STRING_ATTRIBUTE, sizeof(steam->serial_no), ATTRIB_STR_UNIT_SERIAL};
>> - u8 reply[3 + STEAM_SERIAL_LEN + 1];
>> + u8 reply[3 + STEAM_SERIAL_LEN + 1] = { 0 };
>>
>> mutex_lock(&steam->report_mutex);
>> ret = steam_send_report(steam, cmd, sizeof(cmd));
>> --
>> 2.25.1
>>
>
Vicki
next prev parent reply other threads:[~2026-08-03 20:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-09 8:35 [syzbot] [usb?] [input?] KMSAN: uninit-value in steam_register syzbot
2026-06-10 12:01 ` [PATCH] HID: hid-steam: fix uninit-value access in steam_get_serial Pei Xiao
2026-06-10 12:17 ` sashiko-bot
2026-08-03 19:34 ` Jiri Kosina
2026-08-03 20:39 ` Vicki Pfau [this message]
2026-08-04 0:58 ` Pei Xiao
2026-08-04 1:05 ` Vicki Pfau
2026-08-04 1:41 ` Pei Xiao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5ad5f7d4-a29f-409a-8153-c162059807b2@endrift.com \
--to=vi@endrift.com \
--cc=bentiss@kernel.org \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+75f3f9bff8c510602d36@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
--cc=xiaopei01@kylinos.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox