1. 04 11月, 2016 1 次提交
  2. 14 9月, 2016 1 次提交
    • G
      spi: spidev_test: Fix buffer overflow in unescape() · 0278b34b
      Geert Uytterhoeven 提交于
      Sometimes spidev_test crashes with:
      
          *** Error in `spidev_test': munmap_chunk(): invalid pointer: 0x00022020 ***
          Aborted
      
      or just
      
          Segmentation fault
      
      This is due to transfer_escaped_string() miscalculating the required
      size of the buffer by one byte, causing a buffer overflow in unescape().
      
      Drop the bogus "+ 1" in the strlen() parameter to fix this.
      
      Note that unescape() never copies the zero-terminator of the source
      string, so it writes at most as many bytes as the length of the source
      string.
      
      Fixes: 30061915 (spi: spidev_test: Added input buffer from the terminal)
      Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Cc: <stable@vger.kernel.org> # v4.5+
      0278b34b
  3. 15 8月, 2016 1 次提交
    • B
      spi: spidev_test: fix build with musl libc · 8736f802
      Baruch Siach 提交于
      spidev.h uses _IOC_SIZEBITS directly. musl libc does not provide this macro
      unless linux/ioctl.h is included explicitly. Fixes build failures like:
      
      In file included from .../host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/include/sys/ioctl.h:7:0,
                       from .../build/spidev_test-v3.15/spidev_test.c:20:
      .../build/spidev_test-v3.15/spidev_test.c: In function ‘transfer’:
      .../build/spidev_test-v3.15/spidev_test.c:75:18: error: ‘_IOC_SIZEBITS’ undeclared (first use in this function)
        ret = ioctl(fd, SPI_IOC_MESSAGE(1), &tr);
                        ^
      Signed-off-by: NBaruch Siach <baruch@tkos.co.il>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      8736f802
  4. 09 12月, 2015 1 次提交
  5. 23 11月, 2015 6 次提交
  6. 17 4月, 2015 1 次提交
  7. 11 3月, 2015 3 次提交
  8. 27 2月, 2014 1 次提交
  9. 22 2月, 2014 1 次提交
  10. 30 4月, 2010 1 次提交
  11. 23 9月, 2009 1 次提交
  12. 01 7月, 2009 1 次提交
    • D
      spi: new spi->mode bits · b55f627f
      David Brownell 提交于
      Add two new spi_device.mode bits to accomodate more protocol options, and
      pass them through to usermode drivers:
      
       * SPI_NO_CS ... a second 3-wire variant, where the chipselect
         line is removed instead of a data line; transfers are still
         full duplex.
      
         This obviously has STRONG protocol implications since the
         chipselect transitions can't be used to synchronize state
         transitions with the SPI master.
      
       * SPI_READY ... defines open drain signal that's pulled low
         to pause the clock.  This defines a 5-wire variant (normal
         4-wire SPI plus READY) and two 4-wire variants (READY plus
         each of the 3-wire flavors).
      
         Such hardware flow control can be a big win.  There are ADC
         converters and flash chips that expose READY signals, but not
         many host controllers support it today.
      
      The spi_bitbang code should be changed to use SPI_NO_CS instead of its
      current nonportable hack.  That's a mode most hardware can easily support
      (unlike SPI_READY).
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: "Paulraj, Sandeep" <s-paulraj@ti.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b55f627f
  13. 17 10月, 2007 1 次提交
  14. 01 8月, 2007 1 次提交