1. 28 6月, 2018 1 次提交
  2. 25 6月, 2018 1 次提交
  3. 18 5月, 2018 1 次提交
  4. 16 2月, 2018 1 次提交
    • D
      usb: cdc_acm: prevent race at write to acm while system resumes · b86b8eb6
      Dominik Bozek 提交于
      ACM driver may accept data to transmit while system is not fully
      resumed. In this case ACM driver buffers data and prepare URBs
      on usb anchor list.
      There is a little chance that two tasks put a char and initiate
      acm_tty_flush_chars(). In such a case, driver will put one URB
      twice on usb anchor list.
      This patch also reset length of data before resue of a buffer.
      This not only prevent sending rubbish, but also lower risc of race.
      
      Without this patch we hit following kernel panic in one of our
      stabilty/stress tests.
      
      [   46.884442] *list_add double add*: new=ffff9b2ab7289330, prev=ffff9b2ab7289330, next=ffff9b2ab81e28e0.
      [   46.884476] Modules linked in: hci_uart btbcm bluetooth rfkill_gpio igb_avb(O) cfg80211 snd_soc_sst_bxt_tdf8532 snd_soc_skl snd_soc_skl_ipc snd_soc_sst_ipc snd_soc_sst_dsp snd_soc_sst_acpi snd_soc_sst_match snd_hda_ext_core snd_hda_core trusty_timer trusty_wall trusty_log trusty_virtio trusty_ipc trusty_mem trusty_irq trusty virtio_ring virtio intel_ipu4_mmu_bxtB0 lib2600_mod_bxtB0 intel_ipu4_isys_mod_bxtB0 lib2600psys_mod_bxtB0 intel_ipu4_psys_mod_bxtB0 intel_ipu4_mod_bxtB0 intel_ipu4_wrapper_bxtB0 intel_ipu4_acpi videobuf2_dma_contig as3638 dw9714 lm3643 crlmodule smiapp smiapp_pll
      [   46.884480] CPU: 1 PID: 33 Comm: kworker/u8:1 Tainted: G     U  W  O    4.9.56-quilt-2e5dc0ac-g618ed69ced6e-dirty #4
      [   46.884489] Workqueue: events_unbound flush_to_ldisc
      [   46.884494]  ffffb98ac012bb08 ffffffffad3e82e5 ffffb98ac012bb58 0000000000000000
      [   46.884497]  ffffb98ac012bb48 ffffffffad0a23d1 00000024ad6374dd ffff9b2ab7289330
      [   46.884500]  ffff9b2ab81e28e0 ffff9b2ab7289330 0000000000000002 0000000000000000
      [   46.884501] Call Trace:
      [   46.884507]  [<ffffffffad3e82e5>] dump_stack+0x67/0x92
      [   46.884511]  [<ffffffffad0a23d1>] __warn+0xd1/0xf0
      [   46.884513]  [<ffffffffad0a244f>] warn_slowpath_fmt+0x5f/0x80
      [   46.884516]  [<ffffffffad407443>] __list_add+0xb3/0xc0
      [   46.884521]  [<ffffffffad71133c>] *usb_anchor_urb*+0x4c/0xa0
      [   46.884524]  [<ffffffffad782c6f>] *acm_tty_flush_chars*+0x8f/0xb0
      [   46.884527]  [<ffffffffad782cd1>] *acm_tty_put_char*+0x41/0x100
      [   46.884530]  [<ffffffffad4ced34>] tty_put_char+0x24/0x40
      [   46.884533]  [<ffffffffad4d3bf5>] do_output_char+0xa5/0x200
      [   46.884535]  [<ffffffffad4d3e98>] __process_echoes+0x148/0x290
      [   46.884538]  [<ffffffffad4d654c>] n_tty_receive_buf_common+0x57c/0xb00
      [   46.884541]  [<ffffffffad4d6ae4>] n_tty_receive_buf2+0x14/0x20
      [   46.884543]  [<ffffffffad4d9662>] tty_ldisc_receive_buf+0x22/0x50
      [   46.884545]  [<ffffffffad4d9c05>] flush_to_ldisc+0xc5/0xe0
      [   46.884549]  [<ffffffffad0bcfe8>] process_one_work+0x148/0x440
      [   46.884551]  [<ffffffffad0bdc19>] worker_thread+0x69/0x4a0
      [   46.884554]  [<ffffffffad0bdbb0>] ? max_active_store+0x80/0x80
      [   46.884556]  [<ffffffffad0c2e10>] kthread+0x110/0x130
      [   46.884559]  [<ffffffffad0c2d00>] ? kthread_park+0x60/0x60
      [   46.884563]  [<ffffffffadad9917>] ret_from_fork+0x27/0x40
      [   46.884566] ---[ end trace 3bd599058b8a9eb3 ]---
      Signed-off-by: NDominik Bozek <dominikx.bozek@intel.com>
      Signed-off-by: NKuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
      Acked-by: NOliver Neukum <oneukum@suse.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b86b8eb6
  5. 12 2月, 2018 1 次提交
    • L
      vfs: do bulk POLL* -> EPOLL* replacement · a9a08845
      Linus Torvalds 提交于
      This is the mindless scripted replacement of kernel use of POLL*
      variables as described by Al, done by this script:
      
          for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do
              L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'`
              for f in $L; do sed -i "-es/^\([^\"]*\)\(\<POLL$V\>\)/\\1E\\2/" $f; done
          done
      
      with de-mangling cleanups yet to come.
      
      NOTE! On almost all architectures, the EPOLL* constants have the same
      values as the POLL* constants do.  But they keyword here is "almost".
      For various bad reasons they aren't the same, and epoll() doesn't
      actually work quite correctly in some cases due to this on Sparc et al.
      
      The next patch from Al will sort out the final differences, and we
      should be all done.
      Scripted-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a9a08845
  6. 24 1月, 2018 1 次提交
  7. 22 1月, 2018 1 次提交
  8. 16 1月, 2018 1 次提交
    • H
      USB: cdc-acm: Do not log urb submission errors on disconnect · f0386c08
      Hans de Goede 提交于
      When disconnected sometimes the cdc-acm driver logs errors like these:
      
      [20278.039417] cdc_acm 2-2:2.1: urb 9 failed submission with -19
      [20278.042924] cdc_acm 2-2:2.1: urb 10 failed submission with -19
      [20278.046449] cdc_acm 2-2:2.1: urb 11 failed submission with -19
      [20278.049920] cdc_acm 2-2:2.1: urb 12 failed submission with -19
      [20278.053442] cdc_acm 2-2:2.1: urb 13 failed submission with -19
      [20278.056915] cdc_acm 2-2:2.1: urb 14 failed submission with -19
      [20278.060418] cdc_acm 2-2:2.1: urb 15 failed submission with -19
      
      Silence these by not logging errors when the result is -ENODEV.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Acked-by: NOliver Neukum <oneukum@suse.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f0386c08
  9. 29 11月, 2017 1 次提交
  10. 07 11月, 2017 1 次提交
    • G
      USB: add SPDX identifiers to all remaining Makefiles · 3efe891f
      Greg Kroah-Hartman 提交于
      It's good to have SPDX identifiers in all files to make it easier to
      audit the kernel tree for correct licenses.
      
      This updates the remaining drivers/usb/*Makefile* that were missing SPDX
      identifiers.  They all get the following identifier:
      	SPDX-License-Identifier: GPL-2.0
      
      The SPDX identifier is a legally binding shorthand, which can be used
      instead of the full boiler plate text.
      
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Kate Stewart <kstewart@linuxfoundation.org>
      Cc: Philippe Ombredanne <pombredanne@nexb.com>
      Cc: Peter Korsgaard <jacmet@sunsite.dk>
      Cc: Thomas Winischhofer <thomas@winischhofer.net>
      Cc: Johan Hovold <johan@kernel.org>
      Acked-by: NHeikki Krogerus <heikki.krogerus@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3efe891f
  11. 04 11月, 2017 2 次提交
  12. 02 11月, 2017 1 次提交
    • G
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman 提交于
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      
      How this work was done:
      
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  13. 27 10月, 2017 1 次提交
  14. 25 10月, 2017 1 次提交
    • M
      locking/atomics: COCCINELLE/treewide: Convert trivial ACCESS_ONCE() patterns... · 6aa7de05
      Mark Rutland 提交于
      locking/atomics: COCCINELLE/treewide: Convert trivial ACCESS_ONCE() patterns to READ_ONCE()/WRITE_ONCE()
      
      Please do not apply this to mainline directly, instead please re-run the
      coccinelle script shown below and apply its output.
      
      For several reasons, it is desirable to use {READ,WRITE}_ONCE() in
      preference to ACCESS_ONCE(), and new code is expected to use one of the
      former. So far, there's been no reason to change most existing uses of
      ACCESS_ONCE(), as these aren't harmful, and changing them results in
      churn.
      
      However, for some features, the read/write distinction is critical to
      correct operation. To distinguish these cases, separate read/write
      accessors must be used. This patch migrates (most) remaining
      ACCESS_ONCE() instances to {READ,WRITE}_ONCE(), using the following
      coccinelle script:
      
      ----
      // Convert trivial ACCESS_ONCE() uses to equivalent READ_ONCE() and
      // WRITE_ONCE()
      
      // $ make coccicheck COCCI=/home/mark/once.cocci SPFLAGS="--include-headers" MODE=patch
      
      virtual patch
      
      @ depends on patch @
      expression E1, E2;
      @@
      
      - ACCESS_ONCE(E1) = E2
      + WRITE_ONCE(E1, E2)
      
      @ depends on patch @
      expression E;
      @@
      
      - ACCESS_ONCE(E)
      + READ_ONCE(E)
      ----
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: davem@davemloft.net
      Cc: linux-arch@vger.kernel.org
      Cc: mpe@ellerman.id.au
      Cc: shuah@kernel.org
      Cc: snitzer@redhat.com
      Cc: thor.thayer@linux.intel.com
      Cc: tj@kernel.org
      Cc: viro@zeniv.linux.org.uk
      Cc: will.deacon@arm.com
      Link: http://lkml.kernel.org/r/1508792849-3115-19-git-send-email-paulmck@linux.vnet.ibm.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      6aa7de05
  15. 17 10月, 2017 1 次提交
    • M
      usb: cdc_acm: Add quirk for Elatec TWN3 · 765fb2f1
      Maksim Salau 提交于
      Elatec TWN3 has the union descriptor on data interface. This results in
      failure to bind the device to the driver with the following log:
        usb 1-1.2: new full speed USB device using streamplug-ehci and address 4
        usb 1-1.2: New USB device found, idVendor=09d8, idProduct=0320
        usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
        usb 1-1.2: Product: RFID Device (COM)
        usb 1-1.2: Manufacturer: OEM
        cdc_acm 1-1.2:1.0: Zero length descriptor references
        cdc_acm: probe of 1-1.2:1.0 failed with error -22
      
      Adding the NO_UNION_NORMAL quirk for the device fixes the issue.
      
      `lsusb -v` of the device:
      
      Bus 001 Device 003: ID 09d8:0320
      Device Descriptor:
        bLength                18
        bDescriptorType         1
        bcdUSB               2.00
        bDeviceClass            2 Communications
        bDeviceSubClass         0
        bDeviceProtocol         0
        bMaxPacketSize0        32
        idVendor           0x09d8
        idProduct          0x0320
        bcdDevice            3.00
        iManufacturer           1 OEM
        iProduct                2 RFID Device (COM)
        iSerial                 0
        bNumConfigurations      1
        Configuration Descriptor:
          bLength                 9
          bDescriptorType         2
          wTotalLength           67
          bNumInterfaces          2
          bConfigurationValue     1
          iConfiguration          0
          bmAttributes         0x80
            (Bus Powered)
          MaxPower              250mA
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        0
            bAlternateSetting       0
            bNumEndpoints           1
            bInterfaceClass         2 Communications
            bInterfaceSubClass      2 Abstract (modem)
            bInterfaceProtocol      1 AT-commands (v.25ter)
            iInterface              0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x83  EP 3 IN
              bmAttributes            3
                Transfer Type            Interrupt
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0020  1x 32 bytes
              bInterval               2
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        1
            bAlternateSetting       0
            bNumEndpoints           2
            bInterfaceClass        10 CDC Data
            bInterfaceSubClass      0 Unused
            bInterfaceProtocol      0
            iInterface              0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x02  EP 2 OUT
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0020  1x 32 bytes
              bInterval               0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x81  EP 1 IN
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0020  1x 32 bytes
              bInterval               0
            CDC Header:
              bcdCDC               1.10
            CDC Call Management:
              bmCapabilities       0x03
                call management
                use DataInterface
              bDataInterface          1
            CDC ACM:
              bmCapabilities       0x06
                sends break
                line coding and serial state
            CDC Union:
              bMasterInterface        0
              bSlaveInterface         1
      Device Status:     0x0000
        (Bus Powered)
      Signed-off-by: NMaksim Salau <msalau@iotecha.com>
      Acked-by: NOliver Neukum <oneukum@suse.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      765fb2f1
  16. 25 9月, 2017 1 次提交
    • B
      USB: cdc-wdm: ignore -EPIPE from GetEncapsulatedResponse · 8fec9355
      Bjørn Mork 提交于
      The driver will forward errors to userspace after turning most of them
      into -EIO. But all status codes are not equal. The -EPIPE (stall) in
      particular can be seen more as a result of normal USB signaling than
      an actual error. The state is automatically cleared by the USB core
      without intervention from either driver or userspace.
      
      And most devices and firmwares will never trigger a stall as a result
      of GetEncapsulatedResponse. This is in fact a requirement for CDC WDM
      devices. Quoting from section 7.1 of the CDC WMC spec revision 1.1:
      
        The function shall not return STALL in response to
        GetEncapsulatedResponse.
      
      But this driver is also handling GetEncapsulatedResponse on behalf of
      the qmi_wwan and cdc_mbim drivers. Unfortunately the relevant specs
      are not as clear wrt stall. So some QMI and MBIM devices *will*
      occasionally stall, causing the GetEncapsulatedResponse to return an
      -EPIPE status. Translating this into -EIO for userspace has proven to
      be harmful. Treating it as an empty read is safer, making the driver
      behave as if the device was conforming to the CDC WDM spec.
      
      There have been numerous reports of issues related to -EPIPE errors
      from some newer CDC MBIM devices in particular, like for example the
      Fibocom L831-EAU.  Testing on this device has shown that the issues
      go away if we simply ignore the -EPIPE status.  Similar handling of
      -EPIPE is already known from e.g. usb_get_string()
      
      The -EPIPE log message is still kept to let us track devices with this
      unexpected behaviour, hoping that it attracts attention from firmware
      developers.
      
      Cc: <stable@vger.kernel.org>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100938Reported-and-tested-by: NChristian Ehrig <christian.ehrig@mediamarktsaturn-bt.com>
      Reported-and-tested-by: NPatrick Chilton <chpatrick@gmail.com>
      Reported-and-tested-by: NAndreas Böhler <news@aboehler.at>
      Signed-off-by: NBjørn Mork <bjorn@mork.no>
      Acked-by: NOliver Neukum <oneukum@suse.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8fec9355
  17. 11 8月, 2017 1 次提交
  18. 22 7月, 2017 1 次提交
  19. 17 7月, 2017 1 次提交
  20. 17 5月, 2017 1 次提交
  21. 26 4月, 2017 1 次提交
  22. 18 4月, 2017 1 次提交
  23. 01 4月, 2017 4 次提交
  24. 29 3月, 2017 1 次提交
  25. 23 3月, 2017 2 次提交
  26. 17 3月, 2017 2 次提交
    • J
      USB: usbtmc: fix probe error path · 2e47c535
      Johan Hovold 提交于
      Make sure to initialise the return value to avoid having allocation
      failures going unnoticed when allocating interrupt-endpoint resources.
      
      This prevents use-after-free or worse when the device is later unbound.
      
      Fixes: dbf3e7f6 ("Implement an ioctl to support the USMTMC-USB488 READ_STATUS_BYTE operation.")
      Cc: stable <stable@vger.kernel.org>     # 4.6
      Cc: Dave Penkler <dpenkler@gmail.com>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2e47c535
    • J
      USB: usbtmc: add missing endpoint sanity check · 687e0687
      Johan Hovold 提交于
      USBTMC devices are required to have a bulk-in and a bulk-out endpoint,
      but the driver failed to verify this, something which could lead to the
      endpoint addresses being taken from uninitialised memory.
      
      Make sure to zero all private data as part of allocation, and add the
      missing endpoint sanity check.
      
      Note that this also addresses a more recently introduced issue, where
      the interrupt-in-presence flag would also be uninitialised whenever the
      optional interrupt-in endpoint is not present. This in turn could lead
      to an interrupt urb being allocated, initialised and submitted based on
      uninitialised values.
      
      Fixes: dbf3e7f6 ("Implement an ioctl to support the USMTMC-USB488 READ_STATUS_BYTE operation.")
      Fixes: 5b775f67 ("USB: add USB test and measurement class driver")
      Cc: stable <stable@vger.kernel.org>     # 2.6.28
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      687e0687
  27. 02 3月, 2017 1 次提交
  28. 16 2月, 2017 1 次提交
  29. 27 1月, 2017 1 次提交
    • J
      USB: cdc-acm: fix TIOCGSERIAL flags · 4ddecf76
      Johan Hovold 提交于
      The driver reports that it always uses a low-latency mode by returning
      the ASYNC_LOW_LATENCY flag through TIOCGSERIAL.
      
      Even if this behaviour could not be changed, this may have made some
      sense prior to 7a9a65ce ("cdc-acm: Fix long standing abuse of
      tty->low_latency") which removed the unconditional setting of the
      corresponding tty low_latency flag (something which had always been
      broken in itself).
      
      Since the driver does not have a low-latency mode, let's drop the flag.
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4ddecf76
  30. 05 12月, 2016 1 次提交
  31. 21 11月, 2016 4 次提交