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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'staging-5.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging into master

Pull staging driver fixes from Greg KH:
"Five small staging driver fixes for 5.8-rc7 to resolve some reported
problems:

- four comedi driver fixes for problems found with them

- a syzbot-found fix for the wlang-ng driver that resolves a much
reported problem.

All of these have been in linux-next with no reported issues"

* tag 'staging-5.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
staging: wlan-ng: properly check endpoint types
staging: comedi: addi_apci_1564: check INSN_CONFIG_DIGITAL_TRIG shift
staging: comedi: addi_apci_1500: check INSN_CONFIG_DIGITAL_TRIG shift
staging: comedi: addi_apci_1032: check INSN_CONFIG_DIGITAL_TRIG shift
staging: comedi: ni_6527: fix INSN_CONFIG_DIGITAL_TRIG support

+63 -19
+14 -6
drivers/staging/comedi/drivers/addi_apci_1032.c
··· 106 106 unsigned int *data) 107 107 { 108 108 struct apci1032_private *devpriv = dev->private; 109 - unsigned int shift, oldmask; 109 + unsigned int shift, oldmask, himask, lomask; 110 110 111 111 switch (data[0]) { 112 112 case INSN_CONFIG_DIGITAL_TRIG: 113 113 if (data[1] != 0) 114 114 return -EINVAL; 115 115 shift = data[3]; 116 - oldmask = (1U << shift) - 1; 116 + if (shift < 32) { 117 + oldmask = (1U << shift) - 1; 118 + himask = data[4] << shift; 119 + lomask = data[5] << shift; 120 + } else { 121 + oldmask = 0xffffffffu; 122 + himask = 0; 123 + lomask = 0; 124 + } 117 125 switch (data[2]) { 118 126 case COMEDI_DIGITAL_TRIG_DISABLE: 119 127 devpriv->ctrl = 0; ··· 144 136 devpriv->mode2 &= oldmask; 145 137 } 146 138 /* configure specified channels */ 147 - devpriv->mode1 |= data[4] << shift; 148 - devpriv->mode2 |= data[5] << shift; 139 + devpriv->mode1 |= himask; 140 + devpriv->mode2 |= lomask; 149 141 break; 150 142 case COMEDI_DIGITAL_TRIG_ENABLE_LEVELS: 151 143 if (devpriv->ctrl != (APCI1032_CTRL_INT_ENA | ··· 162 154 devpriv->mode2 &= oldmask; 163 155 } 164 156 /* configure specified channels */ 165 - devpriv->mode1 |= data[4] << shift; 166 - devpriv->mode2 |= data[5] << shift; 157 + devpriv->mode1 |= himask; 158 + devpriv->mode2 |= lomask; 167 159 break; 168 160 default: 169 161 return -EINVAL;
+19 -5
drivers/staging/comedi/drivers/addi_apci_1500.c
··· 452 452 struct apci1500_private *devpriv = dev->private; 453 453 unsigned int trig = data[1]; 454 454 unsigned int shift = data[3]; 455 - unsigned int hi_mask = data[4] << shift; 456 - unsigned int lo_mask = data[5] << shift; 457 - unsigned int chan_mask = hi_mask | lo_mask; 458 - unsigned int old_mask = (1 << shift) - 1; 455 + unsigned int hi_mask; 456 + unsigned int lo_mask; 457 + unsigned int chan_mask; 458 + unsigned int old_mask; 459 459 unsigned int pm; 460 460 unsigned int pt; 461 461 unsigned int pp; 462 + unsigned int invalid_chan; 462 463 463 464 if (trig > 1) { 464 465 dev_dbg(dev->class_dev, ··· 467 466 return -EINVAL; 468 467 } 469 468 470 - if (chan_mask > 0xffff) { 469 + if (shift <= 16) { 470 + hi_mask = data[4] << shift; 471 + lo_mask = data[5] << shift; 472 + old_mask = (1U << shift) - 1; 473 + invalid_chan = (data[4] | data[5]) >> (16 - shift); 474 + } else { 475 + hi_mask = 0; 476 + lo_mask = 0; 477 + old_mask = 0xffff; 478 + invalid_chan = data[4] | data[5]; 479 + } 480 + chan_mask = hi_mask | lo_mask; 481 + 482 + if (invalid_chan) { 471 483 dev_dbg(dev->class_dev, "invalid digital trigger channel\n"); 472 484 return -EINVAL; 473 485 }
+14 -6
drivers/staging/comedi/drivers/addi_apci_1564.c
··· 331 331 unsigned int *data) 332 332 { 333 333 struct apci1564_private *devpriv = dev->private; 334 - unsigned int shift, oldmask; 334 + unsigned int shift, oldmask, himask, lomask; 335 335 336 336 switch (data[0]) { 337 337 case INSN_CONFIG_DIGITAL_TRIG: 338 338 if (data[1] != 0) 339 339 return -EINVAL; 340 340 shift = data[3]; 341 - oldmask = (1U << shift) - 1; 341 + if (shift < 32) { 342 + oldmask = (1U << shift) - 1; 343 + himask = data[4] << shift; 344 + lomask = data[5] << shift; 345 + } else { 346 + oldmask = 0xffffffffu; 347 + himask = 0; 348 + lomask = 0; 349 + } 342 350 switch (data[2]) { 343 351 case COMEDI_DIGITAL_TRIG_DISABLE: 344 352 devpriv->ctrl = 0; ··· 370 362 devpriv->mode2 &= oldmask; 371 363 } 372 364 /* configure specified channels */ 373 - devpriv->mode1 |= data[4] << shift; 374 - devpriv->mode2 |= data[5] << shift; 365 + devpriv->mode1 |= himask; 366 + devpriv->mode2 |= lomask; 375 367 break; 376 368 case COMEDI_DIGITAL_TRIG_ENABLE_LEVELS: 377 369 if (devpriv->ctrl != (APCI1564_DI_IRQ_ENA | ··· 388 380 devpriv->mode2 &= oldmask; 389 381 } 390 382 /* configure specified channels */ 391 - devpriv->mode1 |= data[4] << shift; 392 - devpriv->mode2 |= data[5] << shift; 383 + devpriv->mode1 |= himask; 384 + devpriv->mode2 |= lomask; 393 385 break; 394 386 default: 395 387 return -EINVAL;
+1 -1
drivers/staging/comedi/drivers/ni_6527.c
··· 332 332 case COMEDI_DIGITAL_TRIG_ENABLE_EDGES: 333 333 /* check shift amount */ 334 334 shift = data[3]; 335 - if (shift >= s->n_chan) { 335 + if (shift >= 32) { 336 336 mask = 0; 337 337 rising = 0; 338 338 falling = 0;
+15 -1
drivers/staging/wlan-ng/prism2usb.c
··· 61 61 const struct usb_device_id *id) 62 62 { 63 63 struct usb_device *dev; 64 - 64 + const struct usb_endpoint_descriptor *epd; 65 + const struct usb_host_interface *iface_desc = interface->cur_altsetting; 65 66 struct wlandevice *wlandev = NULL; 66 67 struct hfa384x *hw = NULL; 67 68 int result = 0; 69 + 70 + if (iface_desc->desc.bNumEndpoints != 2) { 71 + result = -ENODEV; 72 + goto failed; 73 + } 74 + 75 + result = -EINVAL; 76 + epd = &iface_desc->endpoint[1].desc; 77 + if (!usb_endpoint_is_bulk_in(epd)) 78 + goto failed; 79 + epd = &iface_desc->endpoint[2].desc; 80 + if (!usb_endpoint_is_bulk_out(epd)) 81 + goto failed; 68 82 69 83 dev = interface_to_usbdev(interface); 70 84 wlandev = create_wlan();