Re: [GIT PULL] USB/PHY driver patches for 4.17-rc1

2018-04-05 Thread Al Viro
On Thu, Apr 05, 2018 at 12:31:11AM -0700, Christoph Hellwig wrote:
> On Thu, Apr 05, 2018 at 09:19:28AM +0200, Lars-Peter Clausen wrote:
> > On 04/05/2018 08:31 AM, Kees Cook wrote:
> > > On Wed, Apr 4, 2018 at 3:31 AM, Greg KH  
> > > wrote:
> > >> Lars-Peter Clausen (2):
> > >>   usb: gadget: ffs: Execute copy_to_user() with USER_DS set
> > > 
> > > https://git.kernel.org/linus/4058ebf33cb0be88ca516f968eda24ab7b6b93e4
> > > 
> > > Isn't there a better way to do this without the set_fs() usage? We've
> > > been try to eliminate it in the kernel. I thought there was a safer
> > > way to use iters now?
> > 
> > The problem is use_mm(). It needs to be accompanied with set_fs(DS_USER) to
> > work reliably. This has simply been missing for this particular instance of
> > use_mm().
> 
> To me it seems like use_mm() should do set_fs(USER_DS) and unuse_mm()
> should do set_fs(KERNEL_DS) to get drivers outo of this mess.  I'll see
> if I can come up with patches for the next merge window.

Yes on the former, not quite on the latter (we need to go back to the state
before use_mm()).  Said that, drm users of use_mm() look rather fishy and
might be worth a good look...
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] USB/PHY driver patches for 4.17-rc1

2018-04-05 Thread Christoph Hellwig
On Thu, Apr 05, 2018 at 09:19:28AM +0200, Lars-Peter Clausen wrote:
> On 04/05/2018 08:31 AM, Kees Cook wrote:
> > On Wed, Apr 4, 2018 at 3:31 AM, Greg KH  wrote:
> >> Lars-Peter Clausen (2):
> >>   usb: gadget: ffs: Execute copy_to_user() with USER_DS set
> > 
> > https://git.kernel.org/linus/4058ebf33cb0be88ca516f968eda24ab7b6b93e4
> > 
> > Isn't there a better way to do this without the set_fs() usage? We've
> > been try to eliminate it in the kernel. I thought there was a safer
> > way to use iters now?
> 
> The problem is use_mm(). It needs to be accompanied with set_fs(DS_USER) to
> work reliably. This has simply been missing for this particular instance of
> use_mm().

To me it seems like use_mm() should do set_fs(USER_DS) and unuse_mm()
should do set_fs(KERNEL_DS) to get drivers outo of this mess.  I'll see
if I can come up with patches for the next merge window.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] USB/PHY driver patches for 4.17-rc1

2018-04-05 Thread Lars-Peter Clausen
On 04/05/2018 08:31 AM, Kees Cook wrote:
> On Wed, Apr 4, 2018 at 3:31 AM, Greg KH  wrote:
>> Lars-Peter Clausen (2):
>>   usb: gadget: ffs: Execute copy_to_user() with USER_DS set
> 
> https://git.kernel.org/linus/4058ebf33cb0be88ca516f968eda24ab7b6b93e4
> 
> Isn't there a better way to do this without the set_fs() usage? We've
> been try to eliminate it in the kernel. I thought there was a safer
> way to use iters now?

The problem is use_mm(). It needs to be accompanied with set_fs(DS_USER) to
work reliably. This has simply been missing for this particular instance of
use_mm().

Now, in my opinion, use_mm() is not the best approach here in the first
place and instead of using copy_to_user() it is probably better to map the
userspace pages to kernel space and then access them directly. But that's a
lot more intrusive and separate from this issue.

- Lars
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [GIT PULL] USB/PHY driver patches for 4.17-rc1

2018-04-05 Thread Kees Cook
On Wed, Apr 4, 2018 at 3:31 AM, Greg KH  wrote:
> Lars-Peter Clausen (2):
>   usb: gadget: ffs: Execute copy_to_user() with USER_DS set

https://git.kernel.org/linus/4058ebf33cb0be88ca516f968eda24ab7b6b93e4

Isn't there a better way to do this without the set_fs() usage? We've
been try to eliminate it in the kernel. I thought there was a safer
way to use iters now?

-Kees

-- 
Kees Cook
Pixel Security
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] USB/PHY driver patches for 4.17-rc1

2018-04-04 Thread Greg KH
The following changes since commit c698ca5278934c0ae32297a8725ced2e27585d7f:

  Linux 4.16-rc6 (2018-03-18 17:48:42 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/ 
tags/usb-4.17-rc1

for you to fetch changes up to 5267c5e09c25e2ee6242b37833a9bdf9d97f54a2:

  Revert "USB: serial: ftdi_sio: add Id for Physik Instrumente E-870" 
(2018-03-29 18:37:28 +0200)


USB/PHY patches for 4.17-rc1

Here is the big set of USB and PHY driver patches for 4.17-rc1.

Lots of USB typeC work happened this round, with code moving from the
staging directory into the "real" part of the kernel, as well as new
infrastructure being added to be able to handle the different types of
"roles" that typeC requires.

There is also the normal huge set of USB gadget controller and driver
updates, along with XHCI changes, and a raft of other tiny fixes all
over the USB tree.  And the PHY driver updates are merged in here as
well as they interacted with the USB drivers in some places.

All of these have been in linux-next for a while with no reported
issues.

Signed-off-by: Greg Kroah-Hartman 


Adam Thomson (3):
  typec: tcpm: Add PD Rev 3.0 definitions to PD header
  typec: tcpm: Add ADO header for Alert message handling
  typec: tcpm: Add SDB header for Status message handling

Alban Bedel (1):
  usb: host: Remove the deprecated ATH79 USB host config options

Alex Hung (1):
  usb: clarify ACPI spec version and section number for _UPC & _PLD

Alexander Monakov (1):
  phy: berlin-usb: adjust USB_PHY_RX_CTRL init flags

Alexey Khoroshilov (1):
  phy: lpc18xx-usb-otg: error handling in lpc18xx_usb_otg_phy_power_on()

Amelie Delaunay (3):
  usb: dwc2: add support for host mode external vbus supply
  dt-bindings: phy: add support for STM32 USB PHY Controller (USBPHYC)
  phy: stm32: add support for STM32 USB PHY Controller (USBPHYC)

Andy Shevchenko (19):
  USB: dwc2: Re-use DEFINE_SHOW_ATTRIBUTE() macro
  USB: gadget: bcm63xx: Re-use DEFINE_SHOW_ATTRIBUTE() macro
  USB: gadget: gr: Re-use DEFINE_SHOW_ATTRIBUTE() macro
  USB: gadget: pxa25x: Re-use DEFINE_SHOW_ATTRIBUTE() macro
  USB: gadget: pxa27x: Re-use DEFINE_SHOW_ATTRIBUTE() macro
  USB: chipidea: Re-use DEFINE_SHOW_ATTRIBUTE() macro
  USB: dwc2: Re-use DEFINE_SHOW_ATTRIBUTE() macro
  USB: musb: Re-use DEFINE_SHOW_ATTRIBUTE() macro
  USB: gadget: bcm63xx: Re-use DEFINE_SHOW_ATTRIBUTE() macro
  USB: gadget: gr: Re-use DEFINE_SHOW_ATTRIBUTE() macro
  USB: gadget: pxa25x: Re-use DEFINE_SHOW_ATTRIBUTE() macro
  USB: gadget: pxa27x: Re-use DEFINE_SHOW_ATTRIBUTE() macro
  USB: host: fhci: Re-use DEFINE_SHOW_ATTRIBUTE() macro
  USB: host: imx21: Re-use DEFINE_SHOW_ATTRIBUTE() macro
  USB: host: isp116x: Re-use DEFINE_SHOW_ATTRIBUTE() macro
  USB: host: whci: Re-use DEFINE_SHOW_ATTRIBUTE() macro
  USB: typec: Re-use DEFINE_SHOW_ATTRIBUTE() macro
  uwb: Re-use DEFINE_SHOW_ATTRIBUTE() macro
  USB: host: sl811: Re-use DEFINE_SHOW_ATTRIBUTE() macro

Ben Hutchings (1):
  usbip: Correct maximum value of CONFIG_USBIP_VHCI_HC_PORTS

Benjamin Herrenschmidt (1):
  usb/gadget: Add an EP dispose() callback for EP lifetime tracking

Benson Leung (1):
  USB: announce bcdDevice as well as idVendor, idProduct.

Chen-Yu Tsai (1):
  phy: allwinner: sun4i-usb: poll vbus changes on A23/A33 when driving VBUS

Chris Dickens (2):
  usb: gadget: composite: fix incorrect handling of OS desc requests
  usb: gadget: composite: remove duplicated code in OS desc handling

Chris Zhong (2):
  phy: rockchip-typec: force to USB2 if DP at 4 lanes mode
  phy: rockchip-typec: support DP phy switch

Chunfeng Yun (4):
  phy: phy-mtk-tphy: keep default value of mcu_bus_ck_gate_en
  phy: phy-mtk-tphy: add configurable parameters for slew rate calibrate
  dt-bindings: phy-mtk-tphy: add properties for U2 slew rate calibrate
  usb: skip phys initialization of shared hcd

Clemens Werther (1):
  USB: serial: ftdi_sio: add support for Harman FirmwareHubEmulator

Colin Ian King (4):
  phy: tegra: remove redundant self assignment of 'map'
  USB: gadget: function: remove redundant initialization of 'tv_nexus'
  USB: wusbcore: remove redundant re-assignment to pointer 'dev'
  usb: dwc2: fix spelling mistake: "genereted" -> "generated"

Dan Carpenter (1):
  usb: xhci: Clean up error code in xhci_dbc_tty_register_device()

Daniel Gimpelevich (1):
  USB: misc: uss720: more vendor/product ID's

Dmitry Osipenko (1):
  usb: phy: tegra: Increase PHY clock stabilization timeout

Dov Levenglick (1):
  phy: fix structure documentation

Enric Balletbo i Serra (4):
  phy: rockchip-typec: deprecate some DT properties for various register