1. 23 2月, 2016 1 次提交
  2. 17 12月, 2015 3 次提交
  3. 06 8月, 2015 2 次提交
  4. 03 8月, 2015 1 次提交
  5. 21 7月, 2015 1 次提交
  6. 20 3月, 2015 2 次提交
  7. 30 1月, 2015 1 次提交
  8. 04 11月, 2014 5 次提交
  9. 23 10月, 2014 1 次提交
    • F
      usb: gadget: udc: core: fix kernel oops with soft-connect · bfa6b18c
      Felipe Balbi 提交于
      Currently, there's no guarantee that udc->driver
      will be valid when using soft_connect sysfs
      interface. In fact, we can very easily trigger
      a NULL pointer dereference by trying to disconnect
      when a gadget driver isn't loaded.
      
      Fix this bug:
      
      ~# echo disconnect > soft_connect
      [   33.685743] Unable to handle kernel NULL pointer dereference at virtual address 00000014
      [   33.694221] pgd = ed0cc000
      [   33.697174] [00000014] *pgd=ae351831, *pte=00000000, *ppte=00000000
      [   33.703766] Internal error: Oops: 17 [#1] SMP ARM
      [   33.708697] Modules linked in: xhci_plat_hcd xhci_hcd snd_soc_davinci_mcasp snd_soc_tlv320aic3x snd_soc_edma snd_soc_omap snd_soc_evm snd_soc_core dwc3 snd_compress snd_pcm_dmaengine snd_pcm snd_timer snd lis3lv02d_i2c matrix_keypad lis3lv02d dwc3_omap input_polldev soundcore
      [   33.734372] CPU: 0 PID: 1457 Comm: bash Not tainted 3.17.0-09740-ga93416e-dirty #345
      [   33.742457] task: ee71ce00 ti: ee68a000 task.ti: ee68a000
      [   33.748116] PC is at usb_udc_softconn_store+0xa4/0xec
      [   33.753416] LR is at mark_held_locks+0x78/0x90
      [   33.758057] pc : [<c04df128>]    lr : [<c00896a4>]    psr: 20000013
      [   33.758057] sp : ee68bec8  ip : c0c00008  fp : ee68bee4
      [   33.770050] r10: ee6b394c  r9 : ee68bf80  r8 : ee6062c0
      [   33.775508] r7 : 00000000  r6 : ee6062c0  r5 : 0000000b  r4 : ee739408
      [   33.782346] r3 : 00000000  r2 : 00000000  r1 : ee71d390  r0 : ee664170
      [   33.789168] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
      [   33.796636] Control: 10c5387d  Table: ad0cc059  DAC: 00000015
      [   33.802638] Process bash (pid: 1457, stack limit = 0xee68a248)
      [   33.808740] Stack: (0xee68bec8 to 0xee68c000)
      [   33.813299] bec0:                   0000000b c0411284 ee6062c0 00000000 ee68bef4 ee68bee8
      [   33.821862] bee0: c04112ac c04df090 ee68bf14 ee68bef8 c01c2868 c0411290 0000000b ee6b3940
      [   33.830419] bf00: 00000000 00000000 ee68bf4c ee68bf18 c01c1a24 c01c2818 00000000 00000000
      [   33.838990] bf20: ee61b940 ee2f47c0 0000000b 000ce408 ee68bf80 c000f304 ee68a000 00000000
      [   33.847544] bf40: ee68bf7c ee68bf50 c0152dd8 c01c1960 ee68bf7c c0170af8 ee68bf7c ee2f47c0
      [   33.856099] bf60: ee2f47c0 000ce408 0000000b c000f304 ee68bfa4 ee68bf80 c0153330 c0152d34
      [   33.864653] bf80: 00000000 00000000 0000000b 000ce408 b6e7fb50 00000004 00000000 ee68bfa8
      [   33.873204] bfa0: c000f080 c01532e8 0000000b 000ce408 00000001 000ce408 0000000b 00000000
      [   33.881763] bfc0: 0000000b 000ce408 b6e7fb50 00000004 0000000b 00000000 000c5758 00000000
      [   33.890319] bfe0: 00000000 bec2c924 b6de422d b6e1d226 40000030 00000001 75716d2f 00657565
      [   33.898890] [<c04df128>] (usb_udc_softconn_store) from [<c04112ac>] (dev_attr_store+0x28/0x34)
      [   33.907920] [<c04112ac>] (dev_attr_store) from [<c01c2868>] (sysfs_kf_write+0x5c/0x60)
      [   33.916200] [<c01c2868>] (sysfs_kf_write) from [<c01c1a24>] (kernfs_fop_write+0xd0/0x194)
      [   33.924773] [<c01c1a24>] (kernfs_fop_write) from [<c0152dd8>] (vfs_write+0xb0/0x1bc)
      [   33.932874] [<c0152dd8>] (vfs_write) from [<c0153330>] (SyS_write+0x54/0xb0)
      [   33.940247] [<c0153330>] (SyS_write) from [<c000f080>] (ret_fast_syscall+0x0/0x48)
      [   33.948160] Code: e1a01007 e12fff33 e5140004 e5143008 (e5933014)
      [   33.954625] ---[ end trace f849bead94eab7ea ]---
      
      Fixes: 2ccea03a (usb: gadget: introduce UDC Class)
      Cc: <stable@vger.kernel.org> # v3.1+
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      bfa6b18c
  10. 25 9月, 2014 2 次提交
  11. 16 9月, 2014 1 次提交
  12. 12 9月, 2014 1 次提交
  13. 17 7月, 2014 1 次提交
  14. 13 5月, 2014 1 次提交
  15. 04 10月, 2013 1 次提交
  16. 28 8月, 2013 1 次提交
    • G
      USB: gadget: audit sysfs attribute permissions · ce26bd23
      Greg Kroah-Hartman 提交于
      Convert all USB gadget sysfs attributes to use the _RO or _RW variants,
      to make them easier to audit and ensure that the permissions are
      correct.
      
      Note, two are left using the DEVICE_ATTR() macro, as there is no
      DEVICE_ATTR_WO() in Linus's tree, that will happen after 3.12-rc1 is
      out, a follow-on patch will be sent then.
      Reviewed-by: NFelipe Balbi <balbi@ti.com>
      Acked-by: NFelipe Balbi <balbi@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      --
       drivers/usb/gadget/composite.c      |    8 +++-----
       drivers/usb/gadget/dummy_hcd.c      |    8 ++++----
       drivers/usb/gadget/f_mass_storage.c |   14 ++++++--------
       drivers/usb/gadget/net2272.c        |    4 ++--
       drivers/usb/gadget/net2280.c        |   18 +++++++++---------
       drivers/usb/gadget/storage_common.c |   25 ++++++++++++-------------
       drivers/usb/gadget/udc-core.c       |   14 +++++++-------
       7 files changed, 43 insertions(+), 48 deletions(-)
      ce26bd23
  17. 29 7月, 2013 2 次提交
  18. 15 7月, 2013 1 次提交
    • A
      usb: gadget: don't fail when DMA isn't present · 908b9613
      Alan Stern 提交于
      When CONFIG_HAS_DMA isn't enabled, the UDC core gets build errors:
      
      drivers/built-in.o: In function `dma_set_coherent_mask':
      include/linux/dma-mapping.h:93: undefined reference to `dma_supported'
      include/linux/dma-mapping.h:93: undefined reference to `dma_supported'
      drivers/built-in.o: In function `usb_gadget_unmap_request':
      drivers/usb/gadget/udc-core.c:91: undefined reference to `dma_unmap_sg'
      drivers/usb/gadget/udc-core.c:96: undefined reference to `dma_unmap_single'
      drivers/built-in.o: In function `usb_gadget_map_request':
      drivers/usb/gadget/udc-core.c:62: undefined reference to `dma_map_sg'
      drivers/usb/gadget/udc-core.c:71: undefined reference to `dma_map_single'
      drivers/usb/gadget/udc-core.c:74: undefined reference to `dma_mapping_error'
      
      Prevent this by protecting the DMA API routines with preprocessor tests.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: Geert Uytterhoeven <geert@linux-m68k.org>
      Acked-by: NAlexander Shishkin <alexander.shishkin@linux.intel.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      908b9613
  19. 02 4月, 2013 1 次提交
  20. 20 3月, 2013 1 次提交
    • A
      usb: gadget: udc-core: fix a regression during gadget driver unbinding · 511f3c53
      Alan Stern 提交于
      This patch (as1666) fixes a regression in the UDC core.  The core
      takes care of unbinding gadget drivers, and it does the unbinding
      before telling the UDC driver to turn off the controller hardware.
      When the call to the udc_stop callback is made, the gadget no longer
      has a driver.  The callback routine should not be invoked with a
      pointer to the old driver; doing so can cause problems (such as
      use-after-free accesses in net2280).
      
      This patch should be applied, with appropriate context changes, to all
      the stable kernels going back to 3.1.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: <stable@vger.kernel.org>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      511f3c53
  21. 18 3月, 2013 9 次提交
  22. 25 1月, 2013 1 次提交