* Re: [syzbot] Re: [syzbot] [usb?] KMSAN: kernel-infoleak in iowarrior_read
2024-09-12 2:05 [syzbot] [usb?] KMSAN: kernel-infoleak in iowarrior_read syzbot
@ 2024-09-12 14:16 ` syzbot
2024-09-12 14:21 ` Jeongjun Park
` (5 subsequent siblings)
6 siblings, 0 replies; 15+ messages in thread
From: syzbot @ 2024-09-12 14:16 UTC (permalink / raw)
To: linux-kernel
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.
***
Subject: Re: [syzbot] [usb?] KMSAN: kernel-infoleak in iowarrior_read
Author: aha310510@gmail.com
#syz test git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [syzbot] [usb?] KMSAN: kernel-infoleak in iowarrior_read
2024-09-12 2:05 [syzbot] [usb?] KMSAN: kernel-infoleak in iowarrior_read syzbot
2024-09-12 14:16 ` [syzbot] " syzbot
@ 2024-09-12 14:21 ` Jeongjun Park
2024-09-12 15:47 ` syzbot
2024-09-12 18:47 ` [syzbot] " syzbot
` (4 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Jeongjun Park @ 2024-09-12 14:21 UTC (permalink / raw)
To: syzbot+b8080cbc8d286a5fa23a; +Cc: syzkaller-bugs, linux-kernel
#syz test git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
---
drivers/usb/misc/iowarrior.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
index 6d28467ce352..9b5acb312a02 100644
--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -833,7 +833,7 @@ static int iowarrior_probe(struct usb_interface *interface,
dev->int_in_endpoint->bInterval);
/* create an internal buffer for interrupt data from the device */
dev->read_queue =
- kmalloc_array(dev->report_size + 1, MAX_INTERRUPT_BUFFER,
+ kcalloc(dev->report_size + 1, MAX_INTERRUPT_BUFFER,
GFP_KERNEL);
if (!dev->read_queue)
goto error;
--
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [syzbot] KMSAN: kernel-infoleak in iowarrior_read
2024-09-12 2:05 [syzbot] [usb?] KMSAN: kernel-infoleak in iowarrior_read syzbot
2024-09-12 14:16 ` [syzbot] " syzbot
2024-09-12 14:21 ` Jeongjun Park
@ 2024-09-12 18:47 ` syzbot
2024-09-14 20:31 ` [syzbot] [usb?] " Jeongjun Park
` (3 subsequent siblings)
6 siblings, 0 replies; 15+ messages in thread
From: syzbot @ 2024-09-12 18:47 UTC (permalink / raw)
To: linux-kernel
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.
***
Subject: KMSAN: kernel-infoleak in iowarrior_read
Author: djahchankoike@gmail.com
#syz test
iowarrior_callback may send uninitialized data if memcpy fails
copying data from urb to read_queue, check if memcpy is successful
before waking waiting readers.
Signed-off-by: Diogo Jahchan Koike <djahchankoike@gmail.com>
---
drivers/usb/misc/iowarrior.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
index 6d28467ce352..6f5cd6251d76 100644
--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -201,8 +201,9 @@ static void iowarrior_callback(struct urb *urb)
/* +1 for serial number */
offset = intr_idx * (dev->report_size + 1);
- memcpy(dev->read_queue + offset, urb->transfer_buffer,
- dev->report_size);
+ if (!memcpy(dev->read_queue + offset, urb->transfer_buffer,
+ dev->report_size))
+ goto exit;
*(dev->read_queue + offset + (dev->report_size)) = dev->serial_number++;
atomic_set(&dev->intr_idx, aux_idx);
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [syzbot] [usb?] KMSAN: kernel-infoleak in iowarrior_read
2024-09-12 2:05 [syzbot] [usb?] KMSAN: kernel-infoleak in iowarrior_read syzbot
` (2 preceding siblings ...)
2024-09-12 18:47 ` [syzbot] " syzbot
@ 2024-09-14 20:31 ` Jeongjun Park
2024-09-15 1:54 ` syzbot
2024-09-14 20:32 ` Jeongjun Park
` (2 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Jeongjun Park @ 2024-09-14 20:31 UTC (permalink / raw)
To: syzbot+b8080cbc8d286a5fa23a; +Cc: linux-kernel, syzkaller-bugs
#syz test git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [syzbot] [usb?] KMSAN: kernel-infoleak in iowarrior_read
2024-09-12 2:05 [syzbot] [usb?] KMSAN: kernel-infoleak in iowarrior_read syzbot
` (3 preceding siblings ...)
2024-09-14 20:31 ` [syzbot] [usb?] " Jeongjun Park
@ 2024-09-14 20:32 ` Jeongjun Park
2024-09-15 2:09 ` syzbot
2024-09-15 18:13 ` Jeongjun Park
2024-09-15 18:19 ` Jeongjun Park
6 siblings, 1 reply; 15+ messages in thread
From: Jeongjun Park @ 2024-09-14 20:32 UTC (permalink / raw)
To: syzbot+b8080cbc8d286a5fa23a; +Cc: linux-kernel, syzkaller-bugs
#syz test git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
---
drivers/usb/misc/iowarrior.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
index 6d28467ce352..c36eb831e3db 100644
--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -182,12 +182,6 @@ static void iowarrior_callback(struct urb *urb)
&& (dev->interface->cur_altsetting->desc.bInterfaceNumber == 0)) {
/* + 1 for serial number */
offset = aux_idx * (dev->report_size + 1);
- if (!memcmp
- (dev->read_queue + offset, urb->transfer_buffer,
- dev->report_size)) {
- /* equal values on interface 0 will be ignored */
- goto exit;
- }
}
/* aux_idx become next intr_idx */
--
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [syzbot] [usb?] KMSAN: kernel-infoleak in iowarrior_read
2024-09-14 20:32 ` Jeongjun Park
@ 2024-09-15 2:09 ` syzbot
0 siblings, 0 replies; 15+ messages in thread
From: syzbot @ 2024-09-15 2:09 UTC (permalink / raw)
To: aha310510, linux-kernel, syzkaller-bugs
Hello,
syzbot has tested the proposed patch but the reproducer is still triggering an issue:
KMSAN: kernel-infoleak in iowarrior_read
=====================================================
BUG: KMSAN: kernel-infoleak in instrument_copy_to_user include/linux/instrumented.h:114 [inline]
BUG: KMSAN: kernel-infoleak in _inline_copy_to_user include/linux/uaccess.h:180 [inline]
BUG: KMSAN: kernel-infoleak in _copy_to_user+0xbc/0x110 lib/usercopy.c:26
instrument_copy_to_user include/linux/instrumented.h:114 [inline]
_inline_copy_to_user include/linux/uaccess.h:180 [inline]
_copy_to_user+0xbc/0x110 lib/usercopy.c:26
copy_to_user include/linux/uaccess.h:209 [inline]
iowarrior_read+0xb02/0xdc0 drivers/usb/misc/iowarrior.c:320
vfs_read+0x2a1/0xf60 fs/read_write.c:474
ksys_read+0x20f/0x4c0 fs/read_write.c:619
__do_sys_read fs/read_write.c:629 [inline]
__se_sys_read fs/read_write.c:627 [inline]
__x64_sys_read+0x93/0xe0 fs/read_write.c:627
x64_sys_call+0x3055/0x3ba0 arch/x86/include/generated/asm/syscalls_64.h:1
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcd/0x1e0 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Uninit was created at:
slab_post_alloc_hook mm/slub.c:3998 [inline]
slab_alloc_node mm/slub.c:4041 [inline]
__do_kmalloc_node mm/slub.c:4161 [inline]
__kmalloc_noprof+0x661/0xf30 mm/slub.c:4174
kmalloc_noprof include/linux/slab.h:685 [inline]
kmalloc_array_noprof include/linux/slab.h:726 [inline]
iowarrior_probe+0x10ea/0x1b90 drivers/usb/misc/iowarrior.c:830
usb_probe_interface+0xd6f/0x1350 drivers/usb/core/driver.c:399
really_probe+0x4db/0xd90 drivers/base/dd.c:657
__driver_probe_device+0x2ab/0x5d0 drivers/base/dd.c:799
driver_probe_device+0x72/0x890 drivers/base/dd.c:829
__device_attach_driver+0x568/0x9e0 drivers/base/dd.c:957
bus_for_each_drv+0x403/0x620 drivers/base/bus.c:457
__device_attach+0x3c1/0x650 drivers/base/dd.c:1029
device_initial_probe+0x32/0x40 drivers/base/dd.c:1078
bus_probe_device+0x3dc/0x5c0 drivers/base/bus.c:532
device_add+0x13aa/0x1ba0 drivers/base/core.c:3682
usb_set_configuration+0x31c9/0x38d0 drivers/usb/core/message.c:2210
usb_generic_driver_probe+0x109/0x2a0 drivers/usb/core/generic.c:254
usb_probe_device+0x3a7/0x690 drivers/usb/core/driver.c:294
really_probe+0x4db/0xd90 drivers/base/dd.c:657
__driver_probe_device+0x2ab/0x5d0 drivers/base/dd.c:799
driver_probe_device+0x72/0x890 drivers/base/dd.c:829
__device_attach_driver+0x568/0x9e0 drivers/base/dd.c:957
bus_for_each_drv+0x403/0x620 drivers/base/bus.c:457
__device_attach+0x3c1/0x650 drivers/base/dd.c:1029
device_initial_probe+0x32/0x40 drivers/base/dd.c:1078
bus_probe_device+0x3dc/0x5c0 drivers/base/bus.c:532
device_add+0x13aa/0x1ba0 drivers/base/core.c:3682
usb_new_device+0x15f4/0x2470 drivers/usb/core/hub.c:2651
hub_port_connect drivers/usb/core/hub.c:5521 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5661 [inline]
port_event drivers/usb/core/hub.c:5821 [inline]
hub_event+0x4ffb/0x72d0 drivers/usb/core/hub.c:5903
process_one_work kernel/workqueue.c:3231 [inline]
process_scheduled_works+0xae0/0x1c40 kernel/workqueue.c:3312
worker_thread+0xea7/0x14f0 kernel/workqueue.c:3393
kthread+0x3e2/0x540 kernel/kthread.c:389
ret_from_fork+0x6d/0x90 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
Bytes 0-72 of 73 are uninitialized
Memory access of size 73 starts at ffff88801320c800
Data copied to user address 0000000020000000
CPU: 0 UID: 0 PID: 6466 Comm: syz.0.125 Not tainted 6.11.0-rc7-syzkaller-00149-g0babf683783d-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
=====================================================
Tested on:
commit: 0babf683 Merge tag 'pinctrl-v6.11-4' of git://git.kern..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=115330a9980000
kernel config: https://syzkaller.appspot.com/x/.config?x=ea008021530b2de3
dashboard link: https://syzkaller.appspot.com/bug?extid=b8080cbc8d286a5fa23a
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=171ea407980000
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [syzbot] [usb?] KMSAN: kernel-infoleak in iowarrior_read
2024-09-12 2:05 [syzbot] [usb?] KMSAN: kernel-infoleak in iowarrior_read syzbot
` (4 preceding siblings ...)
2024-09-14 20:32 ` Jeongjun Park
@ 2024-09-15 18:13 ` Jeongjun Park
2024-09-15 18:41 ` syzbot
2024-09-15 18:19 ` Jeongjun Park
6 siblings, 1 reply; 15+ messages in thread
From: Jeongjun Park @ 2024-09-15 18:13 UTC (permalink / raw)
To: syzbot+b8080cbc8d286a5fa23a; +Cc: linux-kernel, syzkaller-bugs
#syz test git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [syzbot] [usb?] KMSAN: kernel-infoleak in iowarrior_read
2024-09-15 18:13 ` Jeongjun Park
@ 2024-09-15 18:41 ` syzbot
0 siblings, 0 replies; 15+ messages in thread
From: syzbot @ 2024-09-15 18:41 UTC (permalink / raw)
To: aha310510, linux-kernel, syzkaller-bugs
Hello,
syzbot has tested the proposed patch but the reproducer is still triggering an issue:
KMSAN: kernel-infoleak in iowarrior_read
=====================================================
BUG: KMSAN: kernel-infoleak in instrument_copy_to_user include/linux/instrumented.h:114 [inline]
BUG: KMSAN: kernel-infoleak in _inline_copy_to_user include/linux/uaccess.h:180 [inline]
BUG: KMSAN: kernel-infoleak in _copy_to_user+0xbc/0x110 lib/usercopy.c:26
instrument_copy_to_user include/linux/instrumented.h:114 [inline]
_inline_copy_to_user include/linux/uaccess.h:180 [inline]
_copy_to_user+0xbc/0x110 lib/usercopy.c:26
copy_to_user include/linux/uaccess.h:209 [inline]
iowarrior_read+0xb02/0xdc0 drivers/usb/misc/iowarrior.c:326
vfs_read+0x2a1/0xf60 fs/read_write.c:474
ksys_read+0x20f/0x4c0 fs/read_write.c:619
__do_sys_read fs/read_write.c:629 [inline]
__se_sys_read fs/read_write.c:627 [inline]
__x64_sys_read+0x93/0xe0 fs/read_write.c:627
x64_sys_call+0x3055/0x3ba0 arch/x86/include/generated/asm/syscalls_64.h:1
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcd/0x1e0 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Uninit was created at:
slab_post_alloc_hook mm/slub.c:3998 [inline]
slab_alloc_node mm/slub.c:4041 [inline]
__do_kmalloc_node mm/slub.c:4161 [inline]
__kmalloc_noprof+0x661/0xf30 mm/slub.c:4174
kmalloc_noprof include/linux/slab.h:685 [inline]
kmalloc_array_noprof include/linux/slab.h:726 [inline]
iowarrior_probe+0x10ea/0x1b90 drivers/usb/misc/iowarrior.c:836
usb_probe_interface+0xd6f/0x1350 drivers/usb/core/driver.c:399
really_probe+0x4db/0xd90 drivers/base/dd.c:657
__driver_probe_device+0x2ab/0x5d0 drivers/base/dd.c:799
driver_probe_device+0x72/0x890 drivers/base/dd.c:829
__device_attach_driver+0x568/0x9e0 drivers/base/dd.c:957
bus_for_each_drv+0x403/0x620 drivers/base/bus.c:457
__device_attach+0x3c1/0x650 drivers/base/dd.c:1029
device_initial_probe+0x32/0x40 drivers/base/dd.c:1078
bus_probe_device+0x3dc/0x5c0 drivers/base/bus.c:532
device_add+0x13aa/0x1ba0 drivers/base/core.c:3682
usb_set_configuration+0x31c9/0x38d0 drivers/usb/core/message.c:2210
usb_generic_driver_probe+0x109/0x2a0 drivers/usb/core/generic.c:254
usb_probe_device+0x3a7/0x690 drivers/usb/core/driver.c:294
really_probe+0x4db/0xd90 drivers/base/dd.c:657
__driver_probe_device+0x2ab/0x5d0 drivers/base/dd.c:799
driver_probe_device+0x72/0x890 drivers/base/dd.c:829
__device_attach_driver+0x568/0x9e0 drivers/base/dd.c:957
bus_for_each_drv+0x403/0x620 drivers/base/bus.c:457
__device_attach+0x3c1/0x650 drivers/base/dd.c:1029
device_initial_probe+0x32/0x40 drivers/base/dd.c:1078
bus_probe_device+0x3dc/0x5c0 drivers/base/bus.c:532
device_add+0x13aa/0x1ba0 drivers/base/core.c:3682
usb_new_device+0x15f4/0x2470 drivers/usb/core/hub.c:2651
hub_port_connect drivers/usb/core/hub.c:5521 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5661 [inline]
port_event drivers/usb/core/hub.c:5821 [inline]
hub_event+0x4ffb/0x72d0 drivers/usb/core/hub.c:5903
process_one_work kernel/workqueue.c:3231 [inline]
process_scheduled_works+0xae0/0x1c40 kernel/workqueue.c:3312
worker_thread+0xea7/0x14f0 kernel/workqueue.c:3393
kthread+0x3e2/0x540 kernel/kthread.c:389
ret_from_fork+0x6d/0x90 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
Bytes 0-72 of 73 are uninitialized
Memory access of size 73 starts at ffff88811889e000
Data copied to user address 0000000020000000
CPU: 1 UID: 0 PID: 6520 Comm: syz.0.143 Not tainted 6.11.0-syzkaller-g98f7e32f20d2 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
=====================================================
Tested on:
commit: 98f7e32f Linux 6.11
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=117b97c7980000
kernel config: https://syzkaller.appspot.com/x/.config?x=3ab8d456be59dad9
dashboard link: https://syzkaller.appspot.com/bug?extid=b8080cbc8d286a5fa23a
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
Note: no patches were applied.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [syzbot] [usb?] KMSAN: kernel-infoleak in iowarrior_read
2024-09-12 2:05 [syzbot] [usb?] KMSAN: kernel-infoleak in iowarrior_read syzbot
` (5 preceding siblings ...)
2024-09-15 18:13 ` Jeongjun Park
@ 2024-09-15 18:19 ` Jeongjun Park
2024-09-15 19:05 ` syzbot
6 siblings, 1 reply; 15+ messages in thread
From: Jeongjun Park @ 2024-09-15 18:19 UTC (permalink / raw)
To: syzbot+b8080cbc8d286a5fa23a; +Cc: linux-kernel, syzkaller-bugs
#syz test git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
---
drivers/usb/misc/iowarrior.c | 46 ++++++++++++++++++++++++++++--------
1 file changed, 36 insertions(+), 10 deletions(-)
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
index 6d28467ce352..0475d3e6a877 100644
--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -277,28 +277,45 @@ static ssize_t iowarrior_read(struct file *file, char __user *buffer,
struct iowarrior *dev;
int read_idx;
int offset;
+ int retval = 0;
dev = file->private_data;
+ if (!dev) {
+ retval = -ENODEV;
+ goto exit;
+ }
+
+ if (mutex_lock_interruptible(&dev->mutex)) {
+ retval = -ERESTARTSYS;
+ goto exit;
+ }
+
/* verify that the device wasn't unplugged */
- if (!dev || !dev->present)
- return -ENODEV;
+ if (!dev->present) {
+ retval = -ENODEV;
+ goto unlock_exit;
+ }
dev_dbg(&dev->interface->dev, "minor %d, count = %zd\n",
dev->minor, count);
/* read count must be packet size (+ time stamp) */
if ((count != dev->report_size)
- && (count != (dev->report_size + 1)))
- return -EINVAL;
+ && (count != (dev->report_size + 1))) {
+ retval = -EINVAL;
+ goto unlock_exit;
+ }
/* repeat until no buffer overrun in callback handler occur */
do {
atomic_set(&dev->overflow_flag, 0);
if ((read_idx = read_index(dev)) == -1) {
/* queue empty */
- if (file->f_flags & O_NONBLOCK)
- return -EAGAIN;
+ if (file->f_flags & O_NONBLOCK) {
+ retval = -EAGAIN;
+ goto unlock_exit;
+ }
else {
//next line will return when there is either new data, or the device is unplugged
int r = wait_event_interruptible(dev->read_wait,
@@ -309,28 +326,37 @@ static ssize_t iowarrior_read(struct file *file, char __user *buffer,
-1));
if (r) {
//we were interrupted by a signal
- return -ERESTART;
+ retval = -ERESTART;
+ goto unlock_exit;
}
if (!dev->present) {
//The device was unplugged
- return -ENODEV;
+ retval = -ENODEV;
+ goto unlock_exit;
}
if (read_idx == -1) {
// Can this happen ???
- return 0;
+ goto unlock_exit;
}
}
}
offset = read_idx * (dev->report_size + 1);
if (copy_to_user(buffer, dev->read_queue + offset, count)) {
- return -EFAULT;
+ retval = -EFAULT;
+ goto unlock_exit;
}
} while (atomic_read(&dev->overflow_flag));
read_idx = ++read_idx == MAX_INTERRUPT_BUFFER ? 0 : read_idx;
atomic_set(&dev->read_idx, read_idx);
+ mutex_unlock(&dev->mutex);
return count;
+
+unlock_exit:
+ mutex_unlock(&dev->mutex);
+exit:
+ return retval;
}
/*
--
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [syzbot] [usb?] KMSAN: kernel-infoleak in iowarrior_read
2024-09-15 18:19 ` Jeongjun Park
@ 2024-09-15 19:05 ` syzbot
0 siblings, 0 replies; 15+ messages in thread
From: syzbot @ 2024-09-15 19:05 UTC (permalink / raw)
To: aha310510, linux-kernel, syzkaller-bugs
Hello,
syzbot has tested the proposed patch but the reproducer is still triggering an issue:
KMSAN: kernel-infoleak in iowarrior_read
=====================================================
BUG: KMSAN: kernel-infoleak in instrument_copy_to_user include/linux/instrumented.h:114 [inline]
BUG: KMSAN: kernel-infoleak in _inline_copy_to_user include/linux/uaccess.h:180 [inline]
BUG: KMSAN: kernel-infoleak in _copy_to_user+0xbc/0x110 lib/usercopy.c:26
instrument_copy_to_user include/linux/instrumented.h:114 [inline]
_inline_copy_to_user include/linux/uaccess.h:180 [inline]
_copy_to_user+0xbc/0x110 lib/usercopy.c:26
copy_to_user include/linux/uaccess.h:209 [inline]
iowarrior_read+0xbb5/0xf00 drivers/usb/misc/iowarrior.c:345
vfs_read+0x2a1/0xf60 fs/read_write.c:474
ksys_read+0x20f/0x4c0 fs/read_write.c:619
__do_sys_read fs/read_write.c:629 [inline]
__se_sys_read fs/read_write.c:627 [inline]
__x64_sys_read+0x93/0xe0 fs/read_write.c:627
x64_sys_call+0x3055/0x3ba0 arch/x86/include/generated/asm/syscalls_64.h:1
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcd/0x1e0 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Uninit was created at:
slab_post_alloc_hook mm/slub.c:3998 [inline]
slab_alloc_node mm/slub.c:4041 [inline]
__do_kmalloc_node mm/slub.c:4161 [inline]
__kmalloc_noprof+0x661/0xf30 mm/slub.c:4174
kmalloc_noprof include/linux/slab.h:685 [inline]
kmalloc_array_noprof include/linux/slab.h:726 [inline]
iowarrior_probe+0x10ea/0x1b90 drivers/usb/misc/iowarrior.c:862
usb_probe_interface+0xd6f/0x1350 drivers/usb/core/driver.c:399
really_probe+0x4db/0xd90 drivers/base/dd.c:657
__driver_probe_device+0x2ab/0x5d0 drivers/base/dd.c:799
driver_probe_device+0x72/0x890 drivers/base/dd.c:829
__device_attach_driver+0x568/0x9e0 drivers/base/dd.c:957
bus_for_each_drv+0x403/0x620 drivers/base/bus.c:457
__device_attach+0x3c1/0x650 drivers/base/dd.c:1029
device_initial_probe+0x32/0x40 drivers/base/dd.c:1078
bus_probe_device+0x3dc/0x5c0 drivers/base/bus.c:532
device_add+0x13aa/0x1ba0 drivers/base/core.c:3682
usb_set_configuration+0x31c9/0x38d0 drivers/usb/core/message.c:2210
usb_generic_driver_probe+0x109/0x2a0 drivers/usb/core/generic.c:254
usb_probe_device+0x3a7/0x690 drivers/usb/core/driver.c:294
really_probe+0x4db/0xd90 drivers/base/dd.c:657
__driver_probe_device+0x2ab/0x5d0 drivers/base/dd.c:799
driver_probe_device+0x72/0x890 drivers/base/dd.c:829
__device_attach_driver+0x568/0x9e0 drivers/base/dd.c:957
bus_for_each_drv+0x403/0x620 drivers/base/bus.c:457
__device_attach+0x3c1/0x650 drivers/base/dd.c:1029
device_initial_probe+0x32/0x40 drivers/base/dd.c:1078
bus_probe_device+0x3dc/0x5c0 drivers/base/bus.c:532
device_add+0x13aa/0x1ba0 drivers/base/core.c:3682
usb_new_device+0x15f4/0x2470 drivers/usb/core/hub.c:2651
hub_port_connect drivers/usb/core/hub.c:5521 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5661 [inline]
port_event drivers/usb/core/hub.c:5821 [inline]
hub_event+0x4ffb/0x72d0 drivers/usb/core/hub.c:5903
process_one_work kernel/workqueue.c:3231 [inline]
process_scheduled_works+0xae0/0x1c40 kernel/workqueue.c:3312
worker_thread+0xea7/0x14f0 kernel/workqueue.c:3393
kthread+0x3e2/0x540 kernel/kthread.c:389
ret_from_fork+0x6d/0x90 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
Bytes 0-72 of 73 are uninitialized
Memory access of size 73 starts at ffff88803f113800
Data copied to user address 0000000020000000
CPU: 0 UID: 0 PID: 6073 Comm: syz.0.16 Not tainted 6.11.0-syzkaller-g98f7e32f20d2-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
=====================================================
Tested on:
commit: 98f7e32f Linux 6.11
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=108e6200580000
kernel config: https://syzkaller.appspot.com/x/.config?x=3ab8d456be59dad9
dashboard link: https://syzkaller.appspot.com/bug?extid=b8080cbc8d286a5fa23a
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=1362c8a9980000
^ permalink raw reply [flat|nested] 15+ messages in thread