1. 21 Apr, 2022 1 commit
    • Kees Cook's avatar
      USB: serial: whiteheat: fix heap overflow in WHITEHEAT_GET_DTR_RTS · e23e50e7
      Kees Cook authored
      The sizeof(struct whitehat_dr_info) can be 4 bytes under CONFIG_AEABI=n
      due to "-mabi=apcs-gnu", even though it has a single u8:
      
      whiteheat_private {
              __u8                       mcr;                  /*     0     1 */
      
              /* size: 4, cachelines: 1, members: 1 */
              /* padding: 3 */
              /* last cacheline: 4 bytes */
      };
      
      The result is technically harmless, as both the source and the
      destinations are currently the same allocation size (4 bytes) and don't
      use their padding, but if anything were to ever be added after the
      "mcr" member in "struct whiteheat_private", it would be overwritten. The
      structs both have a single u8 "mcr" member, but are 4 bytes in padded
      size. The memcpy() destination was explicitly targeting the u8 member
      (size 1) with the length of the whole structure (size 4), triggering
      the memcpy buffer overflow warning:
      
      In file included from include/linux/string.h:253,
                       from include/linux/bitmap.h:11,
                       from include/linux/cpumask.h:12,
                       from include/linux/smp.h:13,
                       from include/linux/lockdep.h:14,
                       from include/linux/spinlock.h:62,
                       from include/linux/mmzone.h:8,
                       from include/linux/gfp.h:6,
                       from include/linux/slab.h:15,
                       from drivers/usb/serial/whiteheat.c:17:
      In function 'fortify_memcpy_chk',
          inlined from 'firm_send_command' at drivers/usb/serial/whiteheat.c:587:4:
      include/linux/fortify-string.h:328:25: warning: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Wattribute-warning]
        328 |                         __write_overflow_field(p_size_field, size);
            |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      Instead, just assign the one byte directly.
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Link: https://lore.kernel.org/lkml/202204142318.vDqjjSFn-lkp@intel.com
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Link: https://lore.kernel.org/r/20220421001234.2421107-1-keescook@chromium.orgSigned-off-by: default avatarJohan Hovold <johan@kernel.org>
      e23e50e7
  2. 20 Apr, 2022 2 commits
    • Bruno Thomsen's avatar
      USB: serial: cp210x: add PIDs for Kamstrup USB Meter Reader · 35a923a0
      Bruno Thomsen authored
      Wireless reading of water and heat meters using 868 MHz wM-Bus mode C1.
      
      The two different product IDs allow detection of dongle antenna
      solution:
      - Internal antenna
      - External antenna using SMA connector
      
      https://www.kamstrup.com/en-en/water-solutions/water-meter-reading/usb-meter-readerSigned-off-by: default avatarBruno Thomsen <bruno.thomsen@gmail.com>
      Link: https://lore.kernel.org/r/20220414081202.5591-1-bruno.thomsen@gmail.com
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      35a923a0
    • Slark Xiao's avatar
      USB: serial: option: add support for Cinterion MV32-WA/MV32-WB · b4a64ed6
      Slark Xiao authored
      Add support for Cinterion device MV32-WA/MV32-WB. MV32-WA PID is
      0x00F1, and MV32-WB PID is 0x00F2.
      
      Test evidence as below:
      T:  Bus=04 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  4 Spd=5000 MxCh= 0
      D:  Ver= 3.20 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs=  1
      P:  Vendor=1e2d ProdID=00f1 Rev=05.04
      S:  Manufacturer=Cinterion
      S:  Product=Cinterion PID 0x00F1 USB Mobile Broadband
      S:  SerialNumber=78ada8c4
      C:  #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA
      I:  If#=0x0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim
      I:  If#=0x1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
      I:  If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
      I:  If#=0x3 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
      I:  If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=option
      I:  If#=0x5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
      
      T:  Bus=04 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  3 Spd=5000 MxCh= 0
      D:  Ver= 3.20 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs=  1
      P:  Vendor=1e2d ProdID=00f2 Rev=05.04
      S:  Manufacturer=Cinterion
      S:  Product=Cinterion PID 0x00F2 USB Mobile Broadband
      S:  SerialNumber=cdd06a78
      C:  #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA
      I:  If#=0x0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim
      I:  If#=0x1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
      I:  If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
      I:  If#=0x3 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
      I:  If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=option
      I:  If#=0x5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
      
      Interface 0&1: MBIM, 2:Modem, 3: GNSS, 4: NMEA, 5: Diag
      GNSS port don't use serial driver.
      Signed-off-by: default avatarSlark Xiao <slark_xiao@163.com>
      Link: https://lore.kernel.org/r/20220414074434.5699-1-slark_xiao@163.com
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      b4a64ed6
  3. 11 Apr, 2022 1 commit
  4. 03 Apr, 2022 8 commits
  5. 02 Apr, 2022 28 commits