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: <Pine.LNX.4.64.0703312122100.6040@jikos.suse.cz>
Date:	Sat, 31 Mar 2007 21:35:19 +0200 (CEST)
From:	Jiri Kosina <jkosina@...e.cz>
To:	Pete Zaitcev <zaitcev@...hat.com>
Cc:	dtor@...ightbb.com, linux-usb-devel@...ts.sourceforge.net,
	linux-kernel@...r.kernel.org, stuard_hayes@...l.com
Subject: Re: usb hid: reset NumLock

On Fri, 30 Mar 2007, Pete Zaitcev wrote:

> @@ -1328,9 +1340,18 @@ static int hid_probe(struct usb_interface *intf, const struct usb_device_id *id)
>  		return -ENODEV;
>  	}
>  
> -	if ((hid->claimed & HID_CLAIMED_INPUT))
> +	if ((hid->claimed & HID_CLAIMED_INPUT)) {
>  		hid_ff_init(hid);
>  
> +		/*
> +		 * We do this only if input has claimed the device because
> +		 * we can only find fields after they were configured in
> +		 * hidinput_connect.
> +		 */
> +		/* if (hid->quirks & HID_QUIRK_RESET_LEDS) */
> +		usbhid_set_leds(hid, LED_NUML, 0);
> +	}
> +
>  	if (hid->quirks & HID_QUIRK_SONY_PS3_CONTROLLER)
>  		hid_fixup_sony_ps3_controller(interface_to_usbdev(intf),
>  			intf->cur_altsetting->desc.bInterfaceNumber);

Hi Pete,

I think I see an issue here. Imagine that you boot a system initially with 
one keyboard connected (usb, ps/2, doesn't matter), and after some time 
you connect second USB keyboard (the NumLock is 'on' on the first keyboard 
when you connect the second one).

Without your patch, the NumLock led will be OK on the second keyboard 
immediately. With your patch, the NumLock will be forced to 'off' and it 
will be out of sync with the first keyboard. The leds will get in sync 
later when any change occurs. 

> diff --git a/include/linux/hid.h b/include/linux/hid.h
> index d26b08f..f592f01 100644
> --- a/include/linux/hid.h
> +++ b/include/linux/hid.h
> @@ -267,6 +267,7 @@ struct hid_item {
>  #define HID_QUIRK_SKIP_OUTPUT_REPORTS		0x00020000
>  #define HID_QUIRK_IGNORE_MOUSE			0x00040000
>  #define HID_QUIRK_SONY_PS3_CONTROLLER		0x00080000
> +#define HID_QUIRK_RESET_LEDS			0x00100000

I think this is not worth a quirk - when we get it working properly, why 
not do it unconditionally for all keyboards?

> URL with details, discussion, rejected patch to read BIOS byte at 0x417:
> https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=228674

"You are not authorized to access bug #228674. To see this bug, you must 
first log in to an account with the appropriate permissions." 

:)

Thanks,

-- 
Jiri Kosina
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ