1. 05 Mar, 2016 9 commits
  2. 02 Mar, 2016 21 commits
  3. 01 Mar, 2016 9 commits
    • Kees Cook's avatar
      lkdtm: improve use-after-free tests · 7c0ae5be
      Kees Cook authored
      This improves the order of operations on the use-after-free tests to
      try to make sure we've executed any available sanity-checking code,
      and to report the poisoning that was found.
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      7c0ae5be
    • David Windsor's avatar
      lkdtm: add test for atomic_t underflow/overflow · 5fd9e480
      David Windsor authored
      dmesg output of running this LKDTM test with PaX:
      
      [187095.475573] lkdtm: No crash points registered, enable through debugfs
      [187118.020257] lkdtm: Performing direct entry WRAP_ATOMIC
      [187118.030045] lkdtm: attempting atomic underflow
      [187118.030929] PAX: refcount overflow detected in: bash:1790, uid/euid: 0/0
      [187118.071667] PAX: refcount overflow occured at: lkdtm_do_action+0x19e/0x400 [lkdtm]
      [187118.081423] CPU: 3 PID: 1790 Comm: bash Not tainted 4.2.6-pax-refcount-split+ #2
      [187118.083403] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
      [187118.102596] task: ffff8800da8de040 ti: ffff8800da8e4000 task.ti: ffff8800da8e4000
      [187118.111321] RIP: 0010:[<ffffffffc00fc2fe>]  [<ffffffffc00fc2fe>] lkdtm_do_action+0x19e/0x400 [lkdtm]
      ...
      [187118.128074] lkdtm: attempting atomic overflow
      [187118.128080] PAX: refcount overflow detected in: bash:1790, uid/euid: 0/0
      [187118.128082] PAX: refcount overflow occured at: lkdtm_do_action+0x1b6/0x400 [lkdtm]
      [187118.128085] CPU: 3 PID: 1790 Comm: bash Not tainted 4.2.6-pax-refcount-split+ #2
      [187118.128086] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
      [187118.128088] task: ffff8800da8de040 ti: ffff8800da8e4000 task.ti: ffff8800da8e4000
      [187118.128092] RIP: 0010:[<ffffffffc00fc316>]  [<ffffffffc00fc316>] lkdtm_do_action+0x1b6/0x400 [lkdtm]
      Signed-off-by: default avatarDavid Windsor <dave@progbits.org>
      [cleaned up whitespacing, keescook]
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      5fd9e480
    • Laura Abbott's avatar
      lkdtm: Add read/write after free tests for buddy memory · 920d451f
      Laura Abbott authored
      The current tests for read/write after free work on slab
      allocated memory. Memory straight from the buddy allocator
      may behave slightly differently and have a different set
      of parameters to test. Add tests for those cases as well.
      
      On a basic x86 boot:
      
       # echo WRITE_BUDDY_AFTER_FREE > /sys/kernel/debug/provoke-crash/DIRECT
      [   22.291950] lkdtm: Performing direct entry WRITE_BUDDY_AFTER_FREE
      [   22.292983] lkdtm: Writing to the buddy page before free
      [   22.293950] lkdtm: Attempting bad write to the buddy page after free
      
       # echo READ_BUDDY_AFTER_FREE > /sys/kernel/debug/provoke-crash/DIRECT
      [   32.375601] lkdtm: Performing direct entry READ_BUDDY_AFTER_FREE
      [   32.379896] lkdtm: Value in memory before free: 12345678
      [   32.383854] lkdtm: Attempting to read from freed memory
      [   32.389309] lkdtm: Buddy page was not poisoned
      
      On x86 with CONFIG_DEBUG_PAGEALLOC and debug_pagealloc=on:
      
       # echo WRITE_BUDDY_AFTER_FREE > /sys/kernel/debug/provoke-crash/DIRECT
      [   17.475533] lkdtm: Performing direct entry WRITE_BUDDY_AFTER_FREE
      [   17.477360] lkdtm: Writing to the buddy page before free
      [   17.479089] lkdtm: Attempting bad write to the buddy page after free
      [   17.480904] BUG: unable to handle kernel paging request at
      ffff88000ebd8000
      
       # echo READ_BUDDY_AFTER_FREE > /sys/kernel/debug/provoke-crash/DIRECT
      [   14.606433] lkdtm: Performing direct entry READ_BUDDY_AFTER_FREE
      [   14.607447] lkdtm: Value in memory before free: 12345678
      [   14.608161] lkdtm: Attempting to read from freed memory
      [   14.608860] BUG: unable to handle kernel paging request at
      ffff88000eba3000
      
      Note that arches without ARCH_SUPPORTS_DEBUG_PAGEALLOC may not
      produce the same crash.
      Signed-off-by: default avatarLaura Abbott <labbott@fedoraproject.org>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      920d451f
    • Laura Abbott's avatar
      lkdtm: Update WRITE_AFTER_FREE test · 250a8988
      Laura Abbott authored
      The SLUB allocator may use the first word of a freed block to store the
      freelist information. This may make it harder to test poisoning
      features. Change the WRITE_AFTER_FREE test to better match what
      the READ_AFTER_FREE test does and also print out a big more information.
      Signed-off-by: default avatarLaura Abbott <labbott@fedoraproject.org>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      250a8988
    • Laura Abbott's avatar
      lkdtm: Add READ_AFTER_FREE test · bc0b8cc6
      Laura Abbott authored
      In a similar manner to WRITE_AFTER_FREE, add a READ_AFTER_FREE
      test to test free poisoning features. Sample output when
      no sanitization is present:
      
       # echo READ_AFTER_FREE > /sys/kernel/debug/provoke-crash/DIRECT
      [   17.542473] lkdtm: Performing direct entry READ_AFTER_FREE
      [   17.543866] lkdtm: Value in memory before free: 12345678
      [   17.545212] lkdtm: Attempting bad read from freed memory
      [   17.546542] lkdtm: Memory was not poisoned
      
      with slub_debug=P:
      
       # echo READ_AFTER_FREE > /sys/kernel/debug/provoke-crash/DIRECT
      [   22.415531] lkdtm: Performing direct entry READ_AFTER_FREE
      [   22.416366] lkdtm: Value in memory before free: 12345678
      [   22.417137] lkdtm: Attempting bad read from freed memory
      [   22.417897] lkdtm: Memory correctly poisoned, calling BUG
      Signed-off-by: default avatarLaura Abbott <labbott@fedoraproject.org>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      bc0b8cc6
    • Kees Cook's avatar
      MAINTAINERS: add myself as lkdtm maintainer · ea861d73
      Kees Cook authored
      Officially claim maintainership over the LKDTM code.
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      ea861d73
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc · 7d46af20
      Linus Torvalds authored
      Pull sparc fixes from David Miller:
      
       1) System call tracing doesn't handle register contents properly across
          the trace.  From Mike Frysinger.
      
       2) Hook up copy_file_range
      
       3) Build fix for 32-bit with newer tools.
      
       4) New sun4v watchdog driver, from Wim Coekaerts.
      
       5) Set context system call has to allow for servicable faults when we
          flush the register windows to memory
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
        sparc64: Fix sparc64_set_context stack handling.
        sparc32: Add -Wa,-Av8 to KBUILD_CFLAGS.
        Add sun4v_wdt watchdog driver
        sparc: Fix system call tracing register handling.
        sparc: Hook up copy_file_range syscall.
      7d46af20
    • David S. Miller's avatar
      sparc64: Fix sparc64_set_context stack handling. · 397d1533
      David S. Miller authored
      Like a signal return, we should use synchronize_user_stack() rather
      than flush_user_windows().
      Reported-by: default avatarIlya Malakhov <ilmalakhovthefirst@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      397d1533
    • David S. Miller's avatar
      sparc32: Add -Wa,-Av8 to KBUILD_CFLAGS. · 22be3b10
      David S. Miller authored
      Binutils used to be (erroneously) extremely permissive about
      instruction usage.  But that got fixed and if you don't properly tell
      it to accept classes of instructions it will fail.
      
      This uncovered a specs bug on sparc in gcc where it wouldn't pass the
      proper options to binutils options.
      
      Deal with this in the kernel build by adding -Wa,-Av8 to KBUILD_CFLAGS.
      Reported-by: default avatarAl Viro <viro@ZenIV.linux.org.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      22be3b10
  4. 29 Feb, 2016 1 commit