Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid

Pull HID fixes from Jiri Kosina:

- NULL pointer dereference fixes in amd_sfh driver (Basavaraj Natikar,
Evgeny Novikov)

- data processing fix for hid-u2fzero (Andrej Shadura)

- fix for out-of-bounds write in hid-betop (F.A.Sulaiman)

- new device IDs / device-specific quirks

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid:
HID: amd_sfh: Fix potential NULL pointer dereference
HID: u2fzero: ignore incomplete packets without data
HID: amd_sfh: Fix potential NULL pointer dereference
HID: wacom: Add new Intuos BT (CTL-4100WL/CTL-6100WL) device IDs
HID: apple: Fix logical maximum and usage maximum of Magic Keyboard JIS
HID: betop: fix slab-out-of-bounds Write in betop_probe

+32 -8
+4 -4
drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
··· 255 255 if (!privdata->cl_data) 256 256 return -ENOMEM; 257 257 258 - rc = devm_add_action_or_reset(&pdev->dev, amd_mp2_pci_remove, privdata); 258 + mp2_select_ops(privdata); 259 + 260 + rc = amd_sfh_hid_client_init(privdata); 259 261 if (rc) 260 262 return rc; 261 263 262 - mp2_select_ops(privdata); 263 - 264 - return amd_sfh_hid_client_init(privdata); 264 + return devm_add_action_or_reset(&pdev->dev, amd_mp2_pci_remove, privdata); 265 265 } 266 266 267 267 static int __maybe_unused amd_mp2_pci_resume(struct device *dev)
+7
drivers/hid/hid-apple.c
··· 336 336 337 337 /* 338 338 * MacBook JIS keyboard has wrong logical maximum 339 + * Magic Keyboard JIS has wrong logical maximum 339 340 */ 340 341 static __u8 *apple_report_fixup(struct hid_device *hdev, __u8 *rdesc, 341 342 unsigned int *rsize) 342 343 { 343 344 struct apple_sc *asc = hid_get_drvdata(hdev); 345 + 346 + if(*rsize >=71 && rdesc[70] == 0x65 && rdesc[64] == 0x65) { 347 + hid_info(hdev, 348 + "fixing up Magic Keyboard JIS report descriptor\n"); 349 + rdesc[64] = rdesc[70] = 0xe7; 350 + } 344 351 345 352 if ((asc->quirks & APPLE_RDESC_JIS) && *rsize >= 60 && 346 353 rdesc[53] == 0x65 && rdesc[59] == 0x65) {
+10 -3
drivers/hid/hid-betopff.c
··· 56 56 { 57 57 struct betopff_device *betopff; 58 58 struct hid_report *report; 59 - struct hid_input *hidinput = 60 - list_first_entry(&hid->inputs, struct hid_input, list); 59 + struct hid_input *hidinput; 61 60 struct list_head *report_list = 62 61 &hid->report_enum[HID_OUTPUT_REPORT].report_list; 63 - struct input_dev *dev = hidinput->input; 62 + struct input_dev *dev; 64 63 int field_count = 0; 65 64 int error; 66 65 int i, j; 66 + 67 + if (list_empty(&hid->inputs)) { 68 + hid_err(hid, "no inputs found\n"); 69 + return -ENODEV; 70 + } 71 + 72 + hidinput = list_first_entry(&hid->inputs, struct hid_input, list); 73 + dev = hidinput->input; 67 74 68 75 if (list_empty(report_list)) { 69 76 hid_err(hid, "no output reports found\n");
+3 -1
drivers/hid/hid-u2fzero.c
··· 198 198 } 199 199 200 200 ret = u2fzero_recv(dev, &req, &resp); 201 - if (ret < 0) 201 + 202 + /* ignore errors or packets without data */ 203 + if (ret < offsetof(struct u2f_hid_msg, init.data)) 202 204 return 0; 203 205 204 206 /* only take the minimum amount of data it is safe to take */
+8
drivers/hid/wacom_wac.c
··· 4746 4746 { "Wacom Intuos Pro S", 31920, 19950, 8191, 63, 4747 4747 INTUOSP2S_BT, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 7, 4748 4748 .touch_max = 10 }; 4749 + static const struct wacom_features wacom_features_0x3c6 = 4750 + { "Wacom Intuos BT S", 15200, 9500, 4095, 63, 4751 + INTUOSHT3_BT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4 }; 4752 + static const struct wacom_features wacom_features_0x3c8 = 4753 + { "Wacom Intuos BT M", 21600, 13500, 4095, 63, 4754 + INTUOSHT3_BT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4 }; 4749 4755 4750 4756 static const struct wacom_features wacom_features_HID_ANY_ID = 4751 4757 { "Wacom HID", .type = HID_GENERIC, .oVid = HID_ANY_ID, .oPid = HID_ANY_ID }; ··· 4925 4919 { USB_DEVICE_WACOM(0x37A) }, 4926 4920 { USB_DEVICE_WACOM(0x37B) }, 4927 4921 { BT_DEVICE_WACOM(0x393) }, 4922 + { BT_DEVICE_WACOM(0x3c6) }, 4923 + { BT_DEVICE_WACOM(0x3c8) }, 4928 4924 { USB_DEVICE_WACOM(0x4001) }, 4929 4925 { USB_DEVICE_WACOM(0x4004) }, 4930 4926 { USB_DEVICE_WACOM(0x5000) },