1. 11 Jul, 2018 7 commits
    • Dave Hansen's avatar
      x86/boot: Fix early command-line parsing when matching at end · 99580265
      Dave Hansen authored
      commit 02afeaae upstream.
      
      The x86 early command line parsing in cmdline_find_option_bool() is
      buggy. If it matches a specified 'option' all the way to the end of the
      command-line, it will consider it a match.
      
      For instance,
      
        cmdline = "foo";
        cmdline_find_option_bool(cmdline, "fool");
      
      will return 1. This is particularly annoying since we have actual FPU
      options like "noxsave" and "noxsaves" So, command-line "foo bar noxsave"
      will match *BOTH* a "noxsave" and "noxsaves". (This turns out not to be
      an actual problem because "noxsave" implies "noxsaves", but it's still
      confusing.)
      
      To fix this, we simplify the code and stop tracking 'len'. 'len'
      was trying to indicate either the NULL terminator *OR* the end of a
      non-NULL-terminated command line at 'COMMAND_LINE_SIZE'. But, each of the
      three states is *already* checking 'cmdline' for a NULL terminator.
      
      We _only_ need to check if we have overrun 'COMMAND_LINE_SIZE', and that
      we can do without keeping 'len' around.
      
      Also add some commends to clarify what is going on.
      Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: fenghua.yu@intel.com
      Cc: yu-cheng.yu@intel.com
      Link: http://lkml.kernel.org/r/20151222225238.9AEB560C@viggo.jf.intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: Ben Hutchings <ben.hutchings@codethink.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      99580265
    • Tetsuo Handa's avatar
      n_tty: Access echo_* variables carefully. · 80fbfb1c
      Tetsuo Handa authored
      commit ebec3f8f upstream.
      
      syzbot is reporting stalls at __process_echoes() [1]. This is because
      since ldata->echo_commit < ldata->echo_tail becomes true for some reason,
      the discard loop is serving as almost infinite loop. This patch tries to
      avoid falling into ldata->echo_commit < ldata->echo_tail situation by
      making access to echo_* variables more carefully.
      
      Since reset_buffer_flags() is called without output_lock held, it should
      not touch echo_* variables. And omit a call to reset_buffer_flags() from
      n_tty_open() by using vzalloc().
      
      Since add_echo_byte() is called without output_lock held, it needs memory
      barrier between storing into echo_buf[] and incrementing echo_head counter.
      echo_buf() needs corresponding memory barrier before reading echo_buf[].
      Lack of handling the possibility of not-yet-stored multi-byte operation
      might be the reason of falling into ldata->echo_commit < ldata->echo_tail
      situation, for if I do WARN_ON(ldata->echo_commit == tail + 1) prior to
      echo_buf(ldata, tail + 1), the WARN_ON() fires.
      
      Also, explicitly masking with buffer for the former "while" loop, and
      use ldata->echo_commit > tail for the latter "while" loop.
      
      [1] https://syzkaller.appspot.com/bug?id=17f23b094cd80df750e5b0f8982c521ee6bcbf40Signed-off-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Reported-by: default avatarsyzbot <syzbot+108696293d7a21ab688f@syzkaller.appspotmail.com>
      Cc: Peter Hurley <peter@hurleysoftware.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      80fbfb1c
    • Laura Abbott's avatar
      staging: android: ion: Return an ERR_PTR in ion_map_kernel · 58fcaeb3
      Laura Abbott authored
      commit 0a2bc003 upstream.
      
      The expected return value from ion_map_kernel is an ERR_PTR. The error
      path for a vmalloc failure currently just returns NULL, triggering
      a warning in ion_buffer_kmap_get. Encode the vmalloc failure as an ERR_PTR.
      
      Reported-by: syzbot+55b1d9f811650de944c6@syzkaller.appspotmail.com
      Signed-off-by: default avatarLaura Abbott <labbott@redhat.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      58fcaeb3
    • Tetsuo Handa's avatar
      n_tty: Fix stall at n_tty_receive_char_special(). · a1f75c3f
      Tetsuo Handa authored
      commit 3d63b7e4 upstream.
      
      syzbot is reporting stalls at n_tty_receive_char_special() [1]. This is
      because comparison is not working as expected since ldata->read_head can
      change at any moment. Mitigate this by explicitly masking with buffer size
      when checking condition for "while" loops.
      
      [1] https://syzkaller.appspot.com/bug?id=3d7481a346958d9469bebbeb0537d5f056bdd6e8Signed-off-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Reported-by: default avatarsyzbot <syzbot+18df353d7540aa6b5467@syzkaller.appspotmail.com>
      Fixes: bc5a5e3f ("n_tty: Don't wrap input buffer indices at buffer size")
      Cc: stable <stable@vger.kernel.org>
      Cc: Peter Hurley <peter@hurleysoftware.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a1f75c3f
    • Karoly Pados's avatar
      USB: serial: cp210x: add Silicon Labs IDs for Windows Update · 216c5fab
      Karoly Pados authored
      commit 2f839823 upstream.
      
      Silicon Labs defines alternative VID/PID pairs for some chips that when
      used will automatically install drivers for Windows users without manual
      intervention. Unfortunately, these IDs are not recognized by the Linux
      module, so using these IDs improves user experience on one platform but
      degrades it on Linux. This patch addresses this problem.
      Signed-off-by: default avatarKaroly Pados <pados@pados.hu>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      216c5fab
    • Johan Hovold's avatar
      USB: serial: cp210x: add CESINEL device ids · 3357fbc7
      Johan Hovold authored
      commit 24160628 upstream.
      
      Add device ids for CESINEL products.
      Reported-by: default avatarCarlos Barcala Lara <cabl@cesinel.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3357fbc7
    • Houston Yaroschoff's avatar
      usb: cdc_acm: Add quirk for Uniden UBC125 scanner · 6f8b3fd2
      Houston Yaroschoff authored
      commit 4a762569 upstream.
      
      Uniden UBC125 radio scanner has USB interface which fails to work
      with cdc_acm driver:
        usb 1-1.5: new full-speed USB device number 4 using xhci_hcd
        cdc_acm 1-1.5:1.0: Zero length descriptor references
        cdc_acm: probe of 1-1.5:1.0 failed with error -22
      
      Adding the NO_UNION_NORMAL quirk for the device fixes the issue:
        usb 1-4: new full-speed USB device number 15 using xhci_hcd
        usb 1-4: New USB device found, idVendor=1965, idProduct=0018
        usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
        usb 1-4: Product: UBC125XLT
        usb 1-4: Manufacturer: Uniden Corp.
        usb 1-4: SerialNumber: 0001
        cdc_acm 1-4:1.0: ttyACM0: USB ACM device
      
      `lsusb -v` of the device:
      
        Bus 001 Device 015: ID 1965:0018 Uniden Corporation
        Device Descriptor:
          bLength                18
          bDescriptorType         1
          bcdUSB               2.00
          bDeviceClass            2 Communications
          bDeviceSubClass         0
          bDeviceProtocol         0
          bMaxPacketSize0        64
          idVendor           0x1965 Uniden Corporation
          idProduct          0x0018
          bcdDevice            0.01
          iManufacturer           1 Uniden Corp.
          iProduct                2 UBC125XLT
          iSerial                 3 0001
          bNumConfigurations      1
          Configuration Descriptor:
            bLength                 9
            bDescriptorType         2
            wTotalLength           48
            bNumInterfaces          2
            bConfigurationValue     1
            iConfiguration          0
            bmAttributes         0x80
              (Bus Powered)
            MaxPower              500mA
            Interface Descriptor:
              bLength                 9
              bDescriptorType         4
              bInterfaceNumber        0
              bAlternateSetting       0
              bNumEndpoints           1
              bInterfaceClass         2 Communications
              bInterfaceSubClass      2 Abstract (modem)
              bInterfaceProtocol      0 None
              iInterface              0
              Endpoint Descriptor:
                bLength                 7
                bDescriptorType         5
                bEndpointAddress     0x87  EP 7 IN
                bmAttributes            3
                  Transfer Type            Interrupt
                  Synch Type               None
                  Usage Type               Data
                wMaxPacketSize     0x0008  1x 8 bytes
                bInterval              10
            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     0x81  EP 1 IN
                bmAttributes            2
                  Transfer Type            Bulk
                  Synch Type               None
                  Usage Type               Data
                wMaxPacketSize     0x0040  1x 64 bytes
                bInterval               0
              Endpoint Descriptor:
                bLength                 7
                bDescriptorType         5
                bEndpointAddress     0x02  EP 2 OUT
                bmAttributes            2
                  Transfer Type            Bulk
                  Synch Type               None
                  Usage Type               Data
                wMaxPacketSize     0x0040  1x 64 bytes
                bInterval               0
        Device Status:     0x0000
          (Bus Powered)
      Signed-off-by: default avatarHouston Yaroschoff <hstn@4ever3.net>
      Cc: stable <stable@vger.kernel.org>
      Acked-by: default avatarOliver Neukum <oneukum@suse.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6f8b3fd2
  2. 03 Jul, 2018 33 commits