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: <nycvar.YFH.7.76.2211221028170.6045@cbobk.fhfr.pm>
Date:   Tue, 22 Nov 2022 10:29:37 +0100 (CET)
From:   Jiri Kosina <jikos@...nel.org>
To:     David Yang <mmyangfl@...il.com>
cc:     Benjamin Tissoires <benjamin.tissoires@...hat.com>,
        linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] HID: kye: Add support for MousePen M508X

On Sun, 20 Nov 2022, David Yang wrote:

> Genius MousePen M508X digitizer tablet sends incorrect report descriptor by
> default. This patch replaces it with a corrected one.
> 
> Signed-off-by: David Yang <mmyangfl@...il.com>

Thanks for the fix. A few comments below.

> @@ -626,18 +751,24 @@ static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc,
>  			*rsize = sizeof(easypen_m610x_rdesc_fixed);
>  		}
>  		break;
> -	case USB_DEVICE_ID_KYE_EASYPEN_M406XE:
> -		if (*rsize == EASYPEN_M406XE_RDESC_ORIG_SIZE) {
> -			rdesc = easypen_m406xe_rdesc_fixed;
> -			*rsize = sizeof(easypen_m406xe_rdesc_fixed);
> -		}
> -		break;
>  	case USB_DEVICE_ID_KYE_PENSKETCH_M912:
>  		if (*rsize == PENSKETCH_M912_RDESC_ORIG_SIZE) {
>  			rdesc = pensketch_m912_rdesc_fixed;
>  			*rsize = sizeof(pensketch_m912_rdesc_fixed);
>  		}
>  		break;
> +	case USB_DEVICE_ID_KYE_MOUSEPEN_M508X:
> +		if (*rsize == MOUSEPEN_M508X_RDESC_ORIG_SIZE) {
> +			rdesc = mousepen_m508x_rdesc_fixed;
> +			*rsize = sizeof(mousepen_m508x_rdesc_fixed);
> +		}
> +		break;
> +	case USB_DEVICE_ID_KYE_EASYPEN_M406XE:
> +		if (*rsize == EASYPEN_M406XE_RDESC_ORIG_SIZE) {
> +			rdesc = easypen_m406xe_rdesc_fixed;
> +			*rsize = sizeof(easypen_m406xe_rdesc_fixed);
> +		}
> +		break;

What is the reason for moving USB_DEVICE_ID_KYE_EASYPEN_M406XE around?

>  	case USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE:
>  		rdesc = kye_consumer_control_fixup(hdev, rdesc, rsize, 104,
>  					"Genius Gila Gaming Mouse");
> @@ -721,8 +852,9 @@ static int kye_probe(struct hid_device *hdev, const struct hid_device_id *id)
>  	case USB_DEVICE_ID_KYE_MOUSEPEN_I608X:
>  	case USB_DEVICE_ID_KYE_MOUSEPEN_I608X_V2:
>  	case USB_DEVICE_ID_KYE_EASYPEN_M610X:
> -	case USB_DEVICE_ID_KYE_EASYPEN_M406XE:
>  	case USB_DEVICE_ID_KYE_PENSKETCH_M912:
> +	case USB_DEVICE_ID_KYE_MOUSEPEN_M508X:
> +	case USB_DEVICE_ID_KYE_EASYPEN_M406XE:

Same here.

>  		ret = kye_tablet_enable(hdev);
>  		if (ret) {
>  			hid_err(hdev, "tablet enabling failed\n");
> @@ -756,6 +888,10 @@ static const struct hid_device_id kye_devices[] = {
>  				USB_DEVICE_ID_KYE_MOUSEPEN_I608X_V2) },
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_KYE,
>  				USB_DEVICE_ID_KYE_EASYPEN_M610X) },
> +	{ HID_USB_DEVICE(USB_VENDOR_ID_KYE,
> +				USB_DEVICE_ID_KYE_PENSKETCH_M912) },
> +	{ HID_USB_DEVICE(USB_VENDOR_ID_KYE,
> +				USB_DEVICE_ID_KYE_MOUSEPEN_M508X) },
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_KYE,
>  				USB_DEVICE_ID_KYE_EASYPEN_M406XE) },
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_KYE,
> @@ -764,8 +900,6 @@ static const struct hid_device_id kye_devices[] = {
>  				USB_DEVICE_ID_GENIUS_GX_IMPERATOR) },
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_KYE,
>  				USB_DEVICE_ID_GENIUS_MANTICORE) },
> -	{ HID_USB_DEVICE(USB_VENDOR_ID_KYE,
> -				USB_DEVICE_ID_KYE_PENSKETCH_M912) },

This looks unrelated and incorrect, why are you dropping 
USB_DEVICE_ID_KYE_PENSKETCH_M912 from the device table?

Thanks,

-- 
Jiri Kosina
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ