Skip to content
Commit 17d6b82d authored by Hongren Zheng's avatar Hongren Zheng Committed by Greg Kroah-Hartman
Browse files

usb/usbip: fix wrong data added to platform device



.data of platform_device_info will be copied into .platform_data of
struct device via platform_device_add_data.

However, vhcis[i] contains a spinlock, is dynamically allocated and
used by other code, so it is not meant to be copied. The workaround
was to use void *vhci as an agent, but it was removed in the commit
suggested below.

This patch adds back the workaround and changes the way of using
platform_data accordingly.

Reported-by: default avatar <syzbot+e0dbc33630a092ccf033@syzkaller.appspotmail.com>
Closes: https://lore.kernel.org/r/00000000000029242706077f3145@google.com/


Reported-by: default avatar <syzbot+6867a9777f4b8dc4e256@syzkaller.appspotmail.com>
Closes: https://lore.kernel.org/r/0000000000007634c1060793197c@google.com/


Fixes: b8aaf639 ("usbip: Use platform_device_register_full()")
Tested-by: default avatar <syzbot+6867a9777f4b8dc4e256@syzkaller.appspotmail.com>
Link: https://lore.kernel.org/r/0000000000007ac87d0607979b6b@google.com/


Signed-off-by: default avatarHongren Zheng <i@zenithal.me>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarShuah Khan <skhan@linuxfoundation.org>
Link: https://lore.kernel.org/r/ZSpHPCaQ5DDA9Ysl@Sun


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d0d27ef8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment