1. 15 10月, 2021 1 次提交
  2. 14 10月, 2021 4 次提交
  3. 07 10月, 2021 6 次提交
  4. 06 10月, 2021 1 次提交
  5. 05 10月, 2021 7 次提交
  6. 04 10月, 2021 1 次提交
    • C
      elf: don't use MAP_FIXED_NOREPLACE for elf interpreter mappings · 9b2f72cc
      Chen Jingwen 提交于
      In commit b212921b ("elf: don't use MAP_FIXED_NOREPLACE for elf
      executable mappings") we still leave MAP_FIXED_NOREPLACE in place for
      load_elf_interp.
      
      Unfortunately, this will cause kernel to fail to start with:
      
          1 (init): Uhuuh, elf segment at 00003ffff7ffd000 requested but the memory is mapped already
          Failed to execute /init (error -17)
      
      The reason is that the elf interpreter (ld.so) has overlapping segments.
      
        readelf -l ld-2.31.so
        Program Headers:
          Type           Offset             VirtAddr           PhysAddr
                         FileSiz            MemSiz              Flags  Align
          LOAD           0x0000000000000000 0x0000000000000000 0x0000000000000000
                         0x000000000002c94c 0x000000000002c94c  R E    0x10000
          LOAD           0x000000000002dae0 0x000000000003dae0 0x000000000003dae0
                         0x00000000000021e8 0x0000000000002320  RW     0x10000
          LOAD           0x000000000002fe00 0x000000000003fe00 0x000000000003fe00
                         0x00000000000011ac 0x0000000000001328  RW     0x10000
      
      The reason for this problem is the same as described in commit
      ad55eac7 ("elf: enforce MAP_FIXED on overlaying elf segments").
      
      Not only executable binaries, elf interpreters (e.g. ld.so) can have
      overlapping elf segments, so we better drop MAP_FIXED_NOREPLACE and go
      back to MAP_FIXED in load_elf_interp.
      
      Fixes: 4ed28639 ("fs, elf: drop MAP_FIXED usage from elf_map")
      Cc: <stable@vger.kernel.org> # v4.19
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Michal Hocko <mhocko@suse.com>
      Signed-off-by: NChen Jingwen <chenjingwen6@huawei.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9b2f72cc
  7. 02 10月, 2021 1 次提交
  8. 01 10月, 2021 9 次提交
  9. 30 9月, 2021 7 次提交
  10. 29 9月, 2021 2 次提交
    • E
      ksmbd: fix documentation for 2 functions · 1018bf24
      Enzo Matsumiya 提交于
      ksmbd_kthread_fn() and create_socket() returns 0 or error code, and not
      task_struct/ERR_PTR.
      Signed-off-by: NEnzo Matsumiya <ematsumiya@suse.de>
      Acked-by: NNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      1018bf24
    • H
      kernfs: also call kernfs_set_rev() for positive dentry · df38d852
      Hou Tao 提交于
      A KMSAN warning is reported by Alexander Potapenko:
      
      BUG: KMSAN: uninit-value in kernfs_dop_revalidate+0x61f/0x840
      fs/kernfs/dir.c:1053
       kernfs_dop_revalidate+0x61f/0x840 fs/kernfs/dir.c:1053
       d_revalidate fs/namei.c:854
       lookup_dcache fs/namei.c:1522
       __lookup_hash+0x3a6/0x590 fs/namei.c:1543
       filename_create+0x312/0x7c0 fs/namei.c:3657
       do_mkdirat+0x103/0x930 fs/namei.c:3900
       __do_sys_mkdir fs/namei.c:3931
       __se_sys_mkdir fs/namei.c:3929
       __x64_sys_mkdir+0xda/0x120 fs/namei.c:3929
       do_syscall_x64 arch/x86/entry/common.c:51
      
      It seems a positive dentry in kernfs becomes a negative dentry directly
      through d_delete() in vfs_rmdir(). dentry->d_time is uninitialized
      when accessing it in kernfs_dop_revalidate(), because it is only
      initialized when created as negative dentry in kernfs_iop_lookup().
      
      The problem can be reproduced by the following command:
      
        cd /sys/fs/cgroup/pids && mkdir hi && stat hi && rmdir hi && stat hi
      
      A simple fixes seems to be initializing d->d_time for positive dentry
      in kernfs_iop_lookup() as well. The downside is the negative dentry
      will be revalidated again after it becomes negative in d_delete(),
      because the revison of its parent must have been increased due to
      its removal.
      
      Alternative solution is implement .d_iput for kernfs, and assign d_time
      for the newly-generated negative dentry in it. But we may need to
      take kernfs_rwsem to protect again the concurrent kernfs_link_sibling()
      on the parent directory, it is a little over-killing. Now the simple
      fix is chosen.
      
      Link: https://marc.info/?l=linux-fsdevel&m=163249838610499
      Fixes: c7e7c042 ("kernfs: use VFS negative dentry caching")
      Reported-by: NAlexander Potapenko <glider@google.com>
      Signed-off-by: NHou Tao <houtao1@huawei.com>
      Link: https://lore.kernel.org/r/20210928140750.1274441-1-houtao1@huawei.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      df38d852
  11. 28 9月, 2021 1 次提交