1. 30 Nov, 2022 1 commit
    • Feng Tang's avatar
      mm/slub, kunit: add SLAB_SKIP_KFENCE flag for cache creation · 4d9dd4b0
      Feng Tang authored
      When kfence is enabled, the buffer allocated from the test case
      could be from a kfence pool, and the operation could be also
      caught and reported by kfence first, causing the case to fail.
      
      With default kfence setting, this is very difficult to be triggered.
      By changing CONFIG_KFENCE_NUM_OBJECTS from 255 to 16383, and
      CONFIG_KFENCE_SAMPLE_INTERVAL from 100 to 5, the allocation from
      kfence did hit 7 times in different slub_kunit cases out of 900
      times of boot test.
      
      To avoid this, initially we tried is_kfence_address() to check this
      and repeated allocation till finding a non-kfence address. Vlastimil
      Babka suggested SLAB_SKIP_KFENCE flag could be used to achieve this,
      and better add a wrapper function for simplifying cache creation.
      Signed-off-by: default avatarFeng Tang <feng.tang@intel.com>
      Reviewed-by: default avatarMarco Elver <elver@google.com>
      Reviewed-by: default avatarHyeonggon Yoo <42.hyeyoo@gmail.com>
      Signed-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
      4d9dd4b0
  2. 11 Nov, 2022 1 commit
    • Feng Tang's avatar
      mm/slub: extend redzone check to extra allocated kmalloc space than requested · 946fa0db
      Feng Tang authored
      kmalloc will round up the request size to a fixed size (mostly power
      of 2), so there could be a extra space than what is requested, whose
      size is the actual buffer size minus original request size.
      
      To better detect out of bound access or abuse of this space, add
      redzone sanity check for it.
      
      In current kernel, some kmalloc user already knows the existence of
      the space and utilizes it after calling 'ksize()' to know the real
      size of the allocated buffer. So we skip the sanity check for objects
      which have been called with ksize(), as treating them as legitimate
      users. Kees Cook is working on sanitizing all these user cases,
      by using kmalloc_size_roundup() to avoid ambiguous usages. And after
      this is done, this special handling for ksize() can be removed.
      
      In some cases, the free pointer could be saved inside the latter
      part of object data area, which may overlap the redzone part(for
      small sizes of kmalloc objects). As suggested by Hyeonggon Yoo,
      force the free pointer to be in meta data area when kmalloc redzone
      debug is enabled, to make all kmalloc objects covered by redzone
      check.
      Suggested-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Signed-off-by: default avatarFeng Tang <feng.tang@intel.com>
      Acked-by: default avatarHyeonggon Yoo <42.hyeyoo@gmail.com>
      Signed-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
      946fa0db
  3. 10 Nov, 2022 2 commits
  4. 07 Nov, 2022 1 commit
  5. 06 Nov, 2022 1 commit
    • Kees Cook's avatar
      mm/slab_common: Restore passing "caller" for tracing · 32868715
      Kees Cook authored
      The "caller" argument was accidentally being ignored in a few places
      that were recently refactored. Restore these "caller" arguments, instead
      of _RET_IP_.
      
      Fixes: 11e9734b ("mm/slab_common: unify NUMA and UMA version of tracepoints")
      Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Roman Gushchin <roman.gushchin@linux.dev>
      Cc: linux-mm@kvack.org
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Acked-by: default avatarHyeonggon Yoo <42.hyeyoo@gmail.com>
      Signed-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
      32868715
  6. 04 Nov, 2022 1 commit
  7. 03 Nov, 2022 1 commit
  8. 23 Oct, 2022 9 commits
  9. 22 Oct, 2022 21 commits
  10. 21 Oct, 2022 2 commits
    • Linus Torvalds's avatar
      Merge tag '6.1-rc1-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 · bd8e9634
      Linus Torvalds authored
      Pull cifs fixes from Steve French:
      
       - memory leak fixes
      
       - fixes for directory leases, including an important one which fixes a
         problem noticed by git functional tests
      
       - fixes relating to missing free_xid calls (helpful for
         tracing/debugging of entry/exit into cifs.ko)
      
       - a multichannel fix
      
       - a small cleanup fix (use of list_move instead of list_del/list_add)
      
      * tag '6.1-rc1-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: update internal module number
        cifs: fix memory leaks in session setup
        cifs: drop the lease for cached directories on rmdir or rename
        smb3: interface count displayed incorrectly
        cifs: Fix memory leak when build ntlmssp negotiate blob failed
        cifs: set rc to -ENOENT if we can not get a dentry for the cached dir
        cifs: use LIST_HEAD() and list_move() to simplify code
        cifs: Fix xid leak in cifs_get_file_info_unix()
        cifs: Fix xid leak in cifs_ses_add_channel()
        cifs: Fix xid leak in cifs_flock()
        cifs: Fix xid leak in cifs_copy_file_range()
        cifs: Fix xid leak in cifs_create()
      bd8e9634
    • Linus Torvalds's avatar
      Merge tag 'nfsd-6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux · 022c028f
      Linus Torvalds authored
      Pull nfsd fixes from Chuck Lever:
       "Fixes for patches merged in v6.1"
      
      * tag 'nfsd-6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux:
        nfsd: ensure we always call fh_verify_error tracepoint
        NFSD: unregister shrinker when nfsd_init_net() fails
      022c028f