[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_BBD3CC8A27DA46FB12D0C64E89AD2ECDEE06@qq.com>
Date: Thu, 5 Sep 2024 22:21:39 +0800
From: Edward Adam Davis <eadavis@...com>
To: syzbot+9d34f80f841e948c3fdb@...kaller.appspotmail.com
Cc: linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [usb?] KMSAN: kernel-usb-infoleak in usbtmc_write
clear save user data buf before copying data from user.
#syz test
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index e9ddaa9b580d..19bfe25e675c 100644
--- a/drivers/usb/class/usbtmc.c
+++ b/drivers/usb/class/usbtmc.c
@@ -1586,6 +1586,7 @@ static ssize_t usbtmc_write(struct file *filp, const char __user *buf,
aligned = (transfersize + (USBTMC_HEADER_SIZE + 3)) & ~3;
}
+ memset(&buffer[USBTMC_HEADER_SIZE], 0, aligned - USBTMC_HEADER_SIZE);
if (copy_from_user(&buffer[USBTMC_HEADER_SIZE], buf, transfersize)) {
retval = -EFAULT;
up(&file_data->limit_write_sem);
Powered by blists - more mailing lists