1. 06 Apr, 2021 1 commit
    • Al Viro's avatar
      Make sure nd->path.mnt and nd->path.dentry are always valid pointers · 7d01ef75
      Al Viro authored
      Initialize them in set_nameidata() and make sure that terminate_walk() clears them
      once the pointers become potentially invalid (i.e. we leave RCU mode or drop them
      in non-RCU one).  Currently we have "path_init() always initializes them and nobody
      accesses them outside of path_init()/terminate_walk() segments", which is asking
      for trouble.
      
      With that change we would have nd->path.{mnt,dentry}
      	1) always valid - NULL or pointing to currently allocated objects.
      	2) non-NULL while we are successfully walking
      	3) NULL when we are not walking at all
      	4) contributing to refcounts whenever non-NULL outside of RCU mode.
      
      Fixes: 6c6ec2b0 ("fs: add support for LOOKUP_CACHED")
      Reported-by: syzbot+c88a7030da47945a3cc3@syzkaller.appspotmail.com
      Tested-by: default avatarChristian Brauner <christian.brauner@ubuntu.com>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      7d01ef75
  2. 25 Mar, 2021 1 commit
    • Al Viro's avatar
      hostfs: fix memory handling in follow_link() · 7f6c411c
      Al Viro authored
      1) argument should not be freed in any case - the caller already has
      it as ->s_fs_info (and uses it a lot afterwards)
      2) allocate readlink buffer with kmalloc() - the caller has no way
      to tell if it's got that (on absolute symlink) or a result of
      kasprintf().  Sure, for SLAB and SLUB kfree() works on results of
      kmem_cache_alloc(), but that's not documented anywhere, might change
      in the future *and* is already not true for SLOB.
      
      Fixes: 52b209f7 ("get rid of hostfs_read_inode()")
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      7f6c411c
  3. 06 Mar, 2021 4 commits
  4. 05 Mar, 2021 33 commits
  5. 04 Mar, 2021 1 commit
    • Jens Axboe's avatar
      kernel: provide create_io_thread() helper · cc440e87
      Jens Axboe authored
      Provide a generic helper for setting up an io_uring worker. Returns a
      task_struct so that the caller can do whatever setup is needed, then call
      wake_up_new_task() to kick it into gear.
      
      Add a kernel_clone_args member, io_thread, which tells copy_process() to
      mark the task with PF_IO_WORKER.
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      cc440e87