Skip to content
  1. Feb 23, 2022
    • John David Anglin's avatar
      parisc: Fix data TLB miss in sba_unmap_sg · f23f0444
      John David Anglin authored
      commit b7d6f44a
      
       upstream.
      
      Rolf Eike Beer reported the following bug:
      
      [1274934.746891] Bad Address (null pointer deref?): Code=15 (Data TLB miss fault) at addr 0000004140000018
      [1274934.746891] CPU: 3 PID: 5549 Comm: cmake Not tainted 5.15.4-gentoo-parisc64 #4
      [1274934.746891] Hardware name: 9000/785/C8000
      [1274934.746891]
      [1274934.746891]      YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
      [1274934.746891] PSW: 00001000000001001111111000001110 Not tainted
      [1274934.746891] r00-03  000000ff0804fe0e 0000000040bc9bc0 00000000406760e4 0000004140000000
      [1274934.746891] r04-07  0000000040b693c0 0000004140000000 000000004a2b08b0 0000000000000001
      [1274934.746891] r08-11  0000000041f98810 0000000000000000 000000004a0a7000 0000000000000001
      [1274934.746891] r12-15  0000000040bddbc0 0000000040c0cbc0 0000000040bddbc0 0000000040bddbc0
      [1274934.746891] r16-19  0000000040bde3c0 0000000040bddbc0 0000000040bde3c0 0000000000000007
      [1274934.746891] r20-23  0000000000000006 000000004a368950 0000000000000000 0000000000000001
      [1274934.746891] r24-27  0000000000001fff 000000000800000e 000000004a1710f0 0000000040b693c0
      [1274934.746891] r28-31  0000000000000001 0000000041f988b0 0000000041f98840 000000004a171118
      [1274934.746891] sr00-03  00000000066e5800 0000000000000000 0000000000000000 00000000066e5800
      [1274934.746891] sr04-07  0000000000000000 0000000000000000 0000000000000000 0000000000000000
      [1274934.746891]
      [1274934.746891] IASQ: 0000000000000000 0000000000000000 IAOQ: 00000000406760e8 00000000406760ec
      [1274934.746891]  IIR: 48780030    ISR: 0000000000000000  IOR: 0000004140000018
      [1274934.746891]  CPU:        3   CR30: 00000040e3a9c000 CR31: ffffffffffffffff
      [1274934.746891]  ORIG_R28: 0000000040acdd58
      [1274934.746891]  IAOQ[0]: sba_unmap_sg+0xb0/0x118
      [1274934.746891]  IAOQ[1]: sba_unmap_sg+0xb4/0x118
      [1274934.746891]  RP(r2): sba_unmap_sg+0xac/0x118
      [1274934.746891] Backtrace:
      [1274934.746891]  [<00000000402740cc>] dma_unmap_sg_attrs+0x6c/0x70
      [1274934.746891]  [<000000004074d6bc>] scsi_dma_unmap+0x54/0x60
      [1274934.746891]  [<00000000407a3488>] mptscsih_io_done+0x150/0xd70
      [1274934.746891]  [<0000000040798600>] mpt_interrupt+0x168/0xa68
      [1274934.746891]  [<0000000040255a48>] __handle_irq_event_percpu+0xc8/0x278
      [1274934.746891]  [<0000000040255c34>] handle_irq_event_percpu+0x3c/0xd8
      [1274934.746891]  [<000000004025ecb4>] handle_percpu_irq+0xb4/0xf0
      [1274934.746891]  [<00000000402548e0>] generic_handle_irq+0x50/0x70
      [1274934.746891]  [<000000004019a254>] call_on_stack+0x18/0x24
      [1274934.746891]
      [1274934.746891] Kernel panic - not syncing: Bad Address (null pointer deref?)
      
      The bug is caused by overrunning the sglist and incorrectly testing
      sg_dma_len(sglist) before nents. Normally this doesn't cause a crash,
      but in this case sglist crossed a page boundary. This occurs in the
      following code:
      
      	while (sg_dma_len(sglist) && nents--) {
      
      The fix is simply to test nents first and move the decrement of nents
      into the loop.
      
      Reported-by: default avatarRolf Eike Beer <eike-kernel@sf-tec.de>
      Signed-off-by: default avatarJohn David Anglin <dave.anglin@bell.net>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f23f0444
    • Randy Dunlap's avatar
      serial: parisc: GSC: fix build when IOSAPIC is not set · 1c4e9863
      Randy Dunlap authored
      commit 6e879367
      
       upstream.
      
      There is a build error when using a kernel .config file from
      'kernel test robot' for a different build problem:
      
      hppa64-linux-ld: drivers/tty/serial/8250/8250_gsc.o: in function `.LC3':
      (.data.rel.ro+0x18): undefined reference to `iosapic_serial_irq'
      
      when:
        CONFIG_GSC=y
        CONFIG_SERIO_GSCPS2=y
        CONFIG_SERIAL_8250_GSC=y
        CONFIG_PCI is not set
          and hence PCI_LBA is not set.
        IOSAPIC depends on PCI_LBA, so IOSAPIC is not set/enabled.
      
      Make the use of iosapic_serial_irq() conditional to fix the build error.
      
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: linux-parisc@vger.kernel.org
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: linux-serial@vger.kernel.org
      Cc: Jiri Slaby <jirislaby@kernel.org>
      Cc: Johan Hovold <johan@kernel.org>
      Suggested-by: default avatarHelge Deller <deller@gmx.de>
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1c4e9863
    • Jann Horn's avatar
      net: usb: ax88179_178a: Fix out-of-bounds accesses in RX fixup · 711b6bf3
      Jann Horn authored
      commit 57bc3d3a upstream.
      
      ax88179_rx_fixup() contains several out-of-bounds accesses that can be
      triggered by a malicious (or defective) USB device, in particular:
      
       - The metadata array (hdr_off..hdr_off+2*pkt_cnt) can be out of bounds,
         causing OOB reads and (on big-endian systems) OOB endianness flips.
       - A packet can overlap the metadata array, causing a later OOB
         endianness flip to corrupt data used by a cloned SKB that has already
         been handed off into the network stack.
       - A packet SKB can be constructed whose tail is far beyond its end,
         causing out-of-bounds heap data to be considered part of the SKB's
         data.
      
      I have tested that this can be used by a malicious USB device to send a
      bogus ICMPv6 Echo Request and receive an ICMPv6 Echo Reply in response
      that contains random kernel heap data.
      It's probably also possible to get OOB writes from this on a
      little-endian system somehow - maybe by triggering skb_cow() via IP
      options processing -, but I haven't tested that.
      
      Fixes: e2ca90c2
      
       ("ax88179_178a: ASIX AX88179_178A USB 3.0/2.0 to gigabit ethernet adapter driver")
      Cc: stable@kernel.org
      Signed-off-by: default avatarJann Horn <jannh@google.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      711b6bf3
    • Nathan Chancellor's avatar
      Makefile.extrawarn: Move -Wunaligned-access to W=1 · 4bc7e76e
      Nathan Chancellor authored
      commit 1cf5f151 upstream.
      
      -Wunaligned-access is a new warning in clang that is default enabled for
      arm and arm64 under certain circumstances within the clang frontend (see
      LLVM commit below). On v5.17-rc2, an ARCH=arm allmodconfig build shows
      1284 total/70 unique instances of this warning (most of the instances
      are in header files), which is quite noisy.
      
      To keep a normal build green through CONFIG_WERROR, only show this
      warning with W=1, which will allow automated build systems to catch new
      instances of the warning so that the total number can be driven down to
      zero eventually since catching unaligned accesses at compile time would
      be generally useful.
      
      Cc: stable@vger.kernel.org
      Link: https://github.com/llvm/llvm-project/commit/35737df4dcd28534bd3090157c224c19b501278a
      Link: https://github.com/ClangBuiltLinux/linux/issues/1569
      Link: https://github.com/ClangBuiltLinux/linux/issues/1576
      
      
      Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      [nathan: Fix conflict due to lack of afe956c5
      
      ]
      Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4bc7e76e
  2. Feb 16, 2022