lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YkvMpWYMhgtDI7aN@kroah.com>
Date:   Tue, 5 Apr 2022 06:59:17 +0200
From:   Greg KH <gregkh@...uxfoundation.org>
To:     Richard Gong <richard.gong@....com>
Cc:     jikos@...nel.org, benjamin.tissoires@...hat.com,
        linux-usb@...r.kernel.org, linux-input@...r.kernel.org,
        linux-kernel@...r.kernel.org, mario.limonciello@....com,
        amit.bhutani@....com
Subject: Re: [PATCH] HID: usbhid: set mouse as a wakeup resource

On Mon, Apr 04, 2022 at 04:45:57PM -0500, Richard Gong wrote:
> USB HID transport layer doesn't set mouse as a wakeup resource by default
> so user can't wake system from s0i3 using wired USB mouse. However, users
> can wake the same system from s0i3 with the same wired USB mouse
> on Windows.

Is that because of the huge good/bad list that Windows has for USB mice?
Or is it this way now on Windows for _ALL_ USB mice?

We have been loath to make this change because not all USB mice could
support this, as well as the "wake up a laptop in a backpack that gets
the touchpad touched" issue.

> 
> To work around this wakeup issue on Linux, the user must manually enable
> wakeup via the following command:
> 	echo enabled > /sys/bus/usb/device/*/power/wakeup
> 
> The mouse is set to wake resource by default to ensure the same behavior
> across operating systems.
> 
> Signed-off-by: Richard Gong <richard.gong@....com>
> ---
>  drivers/hid/usbhid/hid-core.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
> index 54752c85604b..571dded02b3d 100644
> --- a/drivers/hid/usbhid/hid-core.c
> +++ b/drivers/hid/usbhid/hid-core.c
> @@ -1183,8 +1183,10 @@ static int usbhid_start(struct hid_device *hid)
>  	 * devices supporting the boot protocol.
>  	 */
>  	if (interface->desc.bInterfaceSubClass == USB_INTERFACE_SUBCLASS_BOOT &&
> -			interface->desc.bInterfaceProtocol ==
> -				USB_INTERFACE_PROTOCOL_KEYBOARD) {
> +			((interface->desc.bInterfaceProtocol ==
> +				USB_INTERFACE_PROTOCOL_KEYBOARD)
> +			|| (interface->desc.bInterfaceProtocol ==
> +				USB_INTERFACE_PROTOCOL_MOUSE))) {

This is a big change, how many different systems and devices did you
test it on?  What about userspace tools that previously assumed the old
behavior?

Why change this now 20 years later?  What changed to require this now?

In short, unless there is a really good reason now to make this change,
we shouldn't for all the reasons we never did so in the past.  Oh, and
proof of loads of testing will be required as well.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ