An error occurred fetching the project authors.
  1. 16 Feb, 2024 4 commits
  2. 28 Dec, 2023 1 commit
  3. 21 Dec, 2023 1 commit
  4. 12 Dec, 2023 1 commit
    • Al Viro's avatar
      file: massage cleanup of files that failed to open · 7cb537b6
      Al Viro authored
      A file that has never gotten FMODE_OPENED will never have RCU-accessed
      references, its final fput() is equivalent to file_free() and if it
      doesn't have FMODE_BACKING either, it can be done from any context and
      won't need task_work treatment.
      
      Now that we have SLAB_TYPESAFE_BY_RCU we can simplify this and have
      other callers benefit. All of that can be achieved easier is to make
      fput() recoginze that case and call file_free() directly.
      
      No need to introduce a special primitive for that. It also allowed
      things like failing dentry_open() could benefit from that as well.
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      [Christian Brauner <brauner@kernel.org>: massage commit message]
      Link: https://lore.kernel.org/r/20231126020834.GC38156@ZenIVSigned-off-by: default avatarChristian Brauner <brauner@kernel.org>
      7cb537b6
  5. 25 Nov, 2023 2 commits
    • Al Viro's avatar
      rename(): avoid a deadlock in the case of parents having no common ancestor · a8b00268
      Al Viro authored
      ... and fix the directory locking documentation and proof of correctness.
      Holding ->s_vfs_rename_mutex *almost* prevents ->d_parent changes; the
      case where we really don't want it is splicing the root of disconnected
      tree to somewhere.
      
      In other words, ->s_vfs_rename_mutex is sufficient to stabilize "X is an
      ancestor of Y" only if X and Y are already in the same tree.  Otherwise
      it can go from false to true, and one can construct a deadlock on that.
      
      Make lock_two_directories() report an error in such case and update the
      callers of lock_rename()/lock_rename_child() to handle such errors.
      
      And yes, such conditions are not impossible to create ;-/
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      a8b00268
    • Al Viro's avatar
      rename(): fix the locking of subdirectories · 22e111ed
      Al Viro authored
      	We should never lock two subdirectories without having taken
      ->s_vfs_rename_mutex; inode pointer order or not, the "order" proposed
      in 28eceeda "fs: Lock moved directories" is not transitive, with
      the usual consequences.
      
      	The rationale for locking renamed subdirectory in all cases was
      the possibility of race between rename modifying .. in a subdirectory to
      reflect the new parent and another thread modifying the same subdirectory.
      For a lot of filesystems that's not a problem, but for some it can lead
      to trouble (e.g. the case when short directory contents is kept in the
      inode, but creating a file in it might push it across the size limit
      and copy its contents into separate data block(s)).
      
      	However, we need that only in case when the parent does change -
      otherwise ->rename() doesn't need to do anything with .. entry in the
      first place.  Some instances are lazy and do a tautological update anyway,
      but it's really not hard to avoid.
      
      Amended locking rules for rename():
      	find the parent(s) of source and target
      	if source and target have the same parent
      		lock the common parent
      	else
      		lock ->s_vfs_rename_mutex
      		lock both parents, in ancestor-first order; if neither
      		is an ancestor of another, lock the parent of source
      		first.
      	find the source and target.
      	if source and target have the same parent
      		if operation is an overwriting rename of a subdirectory
      			lock the target subdirectory
      	else
      		if source is a subdirectory
      			lock the source
      		if target is a subdirectory
      			lock the target
      	lock non-directories involved, in inode pointer order if both
      	source and target are such.
      
      That way we are guaranteed that parents are locked (for obvious reasons),
      that any renamed non-directory is locked (nfsd relies upon that),
      that any victim is locked (emptiness check needs that, among other things)
      and subdirectory that changes parent is locked (needed to protect the update
      of .. entries).  We are also guaranteed that any operation locking more
      than one directory either takes ->s_vfs_rename_mutex or locks a parent
      followed by its child.
      
      Cc: stable@vger.kernel.org
      Fixes: 28eceeda "fs: Lock moved directories"
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      22e111ed
  6. 20 Nov, 2023 1 commit
  7. 16 Nov, 2023 1 commit
  8. 24 Oct, 2023 1 commit
  9. 19 Oct, 2023 3 commits
    • Mateusz Guzik's avatar
      vfs: shave work on failed file open · 93faf426
      Mateusz Guzik authored
      Failed opens (mostly ENOENT) legitimately happen a lot, for example here
      are stats from stracing kernel build for few seconds (strace -fc make):
      
        % time     seconds  usecs/call     calls    errors syscall
        ------ ----------- ----------- --------- --------- ------------------
          0.76    0.076233           5     15040      3688 openat
      
      (this is tons of header files tried in different paths)
      
      In the common case of there being nothing to close (only the file object
      to free) there is a lot of overhead which can be avoided.
      
      This is most notably delegation of freeing to task_work, which comes
      with an enormous cost (see 021a160a ("fs: use __fput_sync in
      close(2)" for an example).
      
      Benchmarked with will-it-scale with a custom testcase based on
      tests/open1.c, stuffed into tests/openneg.c:
      [snip]
              while (1) {
                      int fd = open("/tmp/nonexistent", O_RDONLY);
                      assert(fd == -1);
      
                      (*iterations)++;
              }
      [/snip]
      
      Sapphire Rapids, openneg_processes -t 1 (ops/s):
      before:	1950013
      after:	2914973 (+49%)
      
      file refcount is checked as a safety belt against buggy consumers with
      an atomic cmpxchg. Technically it is not necessary, but it happens to
      not be measurable due to several other atomics which immediately follow.
      Optmizing them away to make this atomic into a problem is left as an
      exercise for the reader.
      
      v2:
      - unexport fput_badopen and move to fs/internal.h
      - handle the refcount with cmpxchg, adjust commentary accordingly
      - tweak the commit message
      Signed-off-by: default avatarMateusz Guzik <mjguzik@gmail.com>
      Link: https://lore.kernel.org/r/20230926162228.68666-1-mjguzik@gmail.comSigned-off-by: default avatarChristian Brauner <brauner@kernel.org>
      93faf426
    • Luís Henriques's avatar
      fs: simplify misleading code to remove ambiguity regarding ihold()/iput() · 6036c5f1
      Luís Henriques authored
      Because 'inode' is being initialised before checking if 'dentry' is negative
      it looks like an extra iput() on 'inode' may happen since the ihold() is
      done only if the dentry is *not* negative.  In reality this doesn't happen
      because d_is_negative() is never true if ->d_inode is NULL.  This patch only
      makes the code easier to understand, as I was initially mislead by it.
      Signed-off-by: default avatarLuís Henriques <lhenriques@suse.de>
      Link: https://lore.kernel.org/r/20230928152341.303-1-lhenriques@suse.deSigned-off-by: default avatarChristian Brauner <brauner@kernel.org>
      6036c5f1
    • Jeff Layton's avatar
      fs: add a new SB_I_NOUMASK flag · 5aa8fd9c
      Jeff Layton authored
      SB_POSIXACL must be set when a filesystem supports POSIX ACLs, but NFSv4
      also sets this flag to prevent the VFS from applying the umask on
      newly-created files. NFSv4 doesn't support POSIX ACLs however, which
      causes confusion when other subsystems try to test for them.
      
      Add a new SB_I_NOUMASK flag that allows filesystems to opt-in to umask
      stripping without advertising support for POSIX ACLs. Set the new flag
      on NFSv4 instead of SB_POSIXACL.
      
      Also, move mode_strip_umask to namei.h and convert init_mknod and
      init_mkdir to use it.
      Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
      Message-Id: <20230911-acl-fix-v3-1-b25315333f6c@kernel.org>
      Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
      5aa8fd9c
  10. 13 Oct, 2023 1 commit
    • Dan Clash's avatar
      audit,io_uring: io_uring openat triggers audit reference count underflow · 03adc61e
      Dan Clash authored
      An io_uring openat operation can update an audit reference count
      from multiple threads resulting in the call trace below.
      
      A call to io_uring_submit() with a single openat op with a flag of
      IOSQE_ASYNC results in the following reference count updates.
      
      These first part of the system call performs two increments that do not race.
      
      do_syscall_64()
        __do_sys_io_uring_enter()
          io_submit_sqes()
            io_openat_prep()
              __io_openat_prep()
                getname()
                  getname_flags()       /* update 1 (increment) */
                    __audit_getname()   /* update 2 (increment) */
      
      The openat op is queued to an io_uring worker thread which starts the
      opportunity for a race.  The system call exit performs one decrement.
      
      do_syscall_64()
        syscall_exit_to_user_mode()
          syscall_exit_to_user_mode_prepare()
            __audit_syscall_exit()
              audit_reset_context()
                 putname()              /* update 3 (decrement) */
      
      The io_uring worker thread performs one increment and two decrements.
      These updates can race with the system call decrement.
      
      io_wqe_worker()
        io_worker_handle_work()
          io_wq_submit_work()
            io_issue_sqe()
              io_openat()
                io_openat2()
                  do_filp_open()
                    path_openat()
                      __audit_inode()   /* update 4 (increment) */
                  putname()             /* update 5 (decrement) */
              __audit_uring_exit()
                audit_reset_context()
                  putname()             /* update 6 (decrement) */
      
      The fix is to change the refcnt member of struct audit_names
      from int to atomic_t.
      
      kernel BUG at fs/namei.c:262!
      Call Trace:
      ...
       ? putname+0x68/0x70
       audit_reset_context.part.0.constprop.0+0xe1/0x300
       __audit_uring_exit+0xda/0x1c0
       io_issue_sqe+0x1f3/0x450
       ? lock_timer_base+0x3b/0xd0
       io_wq_submit_work+0x8d/0x2b0
       ? __try_to_del_timer_sync+0x67/0xa0
       io_worker_handle_work+0x17c/0x2b0
       io_wqe_worker+0x10a/0x350
      
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/lkml/MW2PR2101MB1033FFF044A258F84AEAA584F1C9A@MW2PR2101MB1033.namprd21.prod.outlook.com/
      Fixes: 5bd2182d ("audit,io_uring,io-wq: add some basic audit support to io_uring")
      Signed-off-by: default avatarDan Clash <daclash@linux.microsoft.com>
      Link: https://lore.kernel.org/r/20231012215518.GA4048@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.netReviewed-by: default avatarJens Axboe <axboe@kernel.dk>
      Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
      03adc61e
  11. 19 Aug, 2023 1 commit
  12. 14 Jul, 2023 1 commit
  13. 04 Jul, 2023 1 commit
    • Jan Kara's avatar
      fs: no need to check source · 66d8fc05
      Jan Kara authored
      The @source inode must be valid. It is even checked via IS_SWAPFILE()
      above making it pretty clear. So no need to check it when we unlock.
      
      What doesn't need to exist is the @target inode. The lock_two_inodes()
      helper currently swaps the @inode1 and @inode2 arguments if @inode1 is
      NULL to have consistent lock class usage. However, we know that at least
      for vfs_rename() that @inode1 is @source and thus is never NULL as per
      above. We also know that @source is a different inode than @target as
      that is checked right at the beginning of vfs_rename(). So we know that
      @source is valid and locked and that @target is locked. So drop the
      check whether @source is non-NULL.
      
      Fixes: 28eceeda ("fs: Lock moved directories")
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Reported-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
      Closes: https://lore.kernel.org/r/202307030026.9sE2pk2x-lkp@intel.com
      Message-Id: <20230703-vfs-rename-source-v1-1-37eebb29b65b@kernel.org>
      [brauner: use commit message from patch I sent concurrently]
      Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
      66d8fc05
  14. 19 Jun, 2023 1 commit
  15. 02 Jun, 2023 2 commits
    • Jan Kara's avatar
      fs: Lock moved directories · 28eceeda
      Jan Kara authored
      When a directory is moved to a different directory, some filesystems
      (udf, ext4, ocfs2, f2fs, and likely gfs2, reiserfs, and others) need to
      update their pointer to the parent and this must not race with other
      operations on the directory. Lock the directories when they are moved.
      Although not all filesystems need this locking, we perform it in
      vfs_rename() because getting the lock ordering right is really difficult
      and we don't want to expose these locking details to filesystems.
      
      CC: stable@vger.kernel.org
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Message-Id: <20230601105830.13168-5-jack@suse.cz>
      Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
      28eceeda
    • Jan Kara's avatar
      fs: Establish locking order for unrelated directories · f23ce757
      Jan Kara authored
      Currently the locking order of inode locks for directories that are not
      in ancestor relationship is not defined because all operations that
      needed to lock two directories like this were serialized by
      sb->s_vfs_rename_mutex. However some filesystems need to lock two
      subdirectories for RENAME_EXCHANGE operations and for this we need the
      locking order established even for two tree-unrelated directories.
      Provide a helper function lock_two_inodes() that establishes lock
      ordering for any two inodes and use it in lock_two_directories().
      
      CC: stable@vger.kernel.org
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Message-Id: <20230601105830.13168-4-jack@suse.cz>
      Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
      f23ce757
  16. 24 Apr, 2023 1 commit
    • Namjae Jeon's avatar
      ksmbd: fix racy issue from using ->d_parent and ->d_name · 74d7970f
      Namjae Jeon authored
      Al pointed out that ksmbd has racy issue from using ->d_parent and ->d_name
      in ksmbd_vfs_unlink and smb2_vfs_rename(). and use new lock_rename_child()
      to lock stable parent while underlying rename racy.
      Introduce vfs_path_parent_lookup helper to avoid out of share access and
      export vfs functions like the following ones to use
      vfs_path_parent_lookup().
       - rename __lookup_hash() to lookup_one_qstr_excl().
       - export lookup_one_qstr_excl().
       - export getname_kernel() and putname().
      
      vfs_path_parent_lookup() is used for parent lookup of destination file
      using absolute pathname given from FILE_RENAME_INFORMATION request.
      Signed-off-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      74d7970f
  17. 21 Apr, 2023 1 commit
  18. 13 Mar, 2023 1 commit
  19. 20 Feb, 2023 1 commit
  20. 19 Jan, 2023 12 commits
    • Christian Brauner's avatar
      fs: port i_{g,u}id_into_vfs{g,u}id() to mnt_idmap · e67fe633
      Christian Brauner authored
      Convert to struct mnt_idmap.
      Remove legacy file_mnt_user_ns() and mnt_user_ns().
      
      Last cycle we merged the necessary infrastructure in
      256c8aed ("fs: introduce dedicated idmap type for mounts").
      This is just the conversion to struct mnt_idmap.
      
      Currently we still pass around the plain namespace that was attached to a
      mount. This is in general pretty convenient but it makes it easy to
      conflate namespaces that are relevant on the filesystem with namespaces
      that are relevent on the mount level. Especially for non-vfs developers
      without detailed knowledge in this area this can be a potential source for
      bugs.
      
      Once the conversion to struct mnt_idmap is done all helpers down to the
      really low-level helpers will take a struct mnt_idmap argument instead of
      two namespace arguments. This way it becomes impossible to conflate the two
      eliminating the possibility of any bugs. All of the vfs and all filesystems
      only operate on struct mnt_idmap.
      Acked-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarChristian Brauner (Microsoft) <brauner@kernel.org>
      e67fe633
    • Christian Brauner's avatar
      fs: port privilege checking helpers to mnt_idmap · 9452e93e
      Christian Brauner authored
      Convert to struct mnt_idmap.
      
      Last cycle we merged the necessary infrastructure in
      256c8aed ("fs: introduce dedicated idmap type for mounts").
      This is just the conversion to struct mnt_idmap.
      
      Currently we still pass around the plain namespace that was attached to a
      mount. This is in general pretty convenient but it makes it easy to
      conflate namespaces that are relevant on the filesystem with namespaces
      that are relevent on the mount level. Especially for non-vfs developers
      without detailed knowledge in this area this can be a potential source for
      bugs.
      
      Once the conversion to struct mnt_idmap is done all helpers down to the
      really low-level helpers will take a struct mnt_idmap argument instead of
      two namespace arguments. This way it becomes impossible to conflate the two
      eliminating the possibility of any bugs. All of the vfs and all filesystems
      only operate on struct mnt_idmap.
      Acked-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarChristian Brauner (Microsoft) <brauner@kernel.org>
      9452e93e
    • Christian Brauner's avatar
      fs: port inode_owner_or_capable() to mnt_idmap · 01beba79
      Christian Brauner authored
      Convert to struct mnt_idmap.
      
      Last cycle we merged the necessary infrastructure in
      256c8aed ("fs: introduce dedicated idmap type for mounts").
      This is just the conversion to struct mnt_idmap.
      
      Currently we still pass around the plain namespace that was attached to a
      mount. This is in general pretty convenient but it makes it easy to
      conflate namespaces that are relevant on the filesystem with namespaces
      that are relevent on the mount level. Especially for non-vfs developers
      without detailed knowledge in this area this can be a potential source for
      bugs.
      
      Once the conversion to struct mnt_idmap is done all helpers down to the
      really low-level helpers will take a struct mnt_idmap argument instead of
      two namespace arguments. This way it becomes impossible to conflate the two
      eliminating the possibility of any bugs. All of the vfs and all filesystems
      only operate on struct mnt_idmap.
      Acked-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarChristian Brauner (Microsoft) <brauner@kernel.org>
      01beba79
    • Christian Brauner's avatar
      fs: port acl to mnt_idmap · 700b7940
      Christian Brauner authored
      Convert to struct mnt_idmap.
      
      Last cycle we merged the necessary infrastructure in
      256c8aed ("fs: introduce dedicated idmap type for mounts").
      This is just the conversion to struct mnt_idmap.
      
      Currently we still pass around the plain namespace that was attached to a
      mount. This is in general pretty convenient but it makes it easy to
      conflate namespaces that are relevant on the filesystem with namespaces
      that are relevent on the mount level. Especially for non-vfs developers
      without detailed knowledge in this area this can be a potential source for
      bugs.
      
      Once the conversion to struct mnt_idmap is done all helpers down to the
      really low-level helpers will take a struct mnt_idmap argument instead of
      two namespace arguments. This way it becomes impossible to conflate the two
      eliminating the possibility of any bugs. All of the vfs and all filesystems
      only operate on struct mnt_idmap.
      Acked-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarChristian Brauner (Microsoft) <brauner@kernel.org>
      700b7940
    • Christian Brauner's avatar
      fs: port xattr to mnt_idmap · 39f60c1c
      Christian Brauner authored
      Convert to struct mnt_idmap.
      
      Last cycle we merged the necessary infrastructure in
      256c8aed ("fs: introduce dedicated idmap type for mounts").
      This is just the conversion to struct mnt_idmap.
      
      Currently we still pass around the plain namespace that was attached to a
      mount. This is in general pretty convenient but it makes it easy to
      conflate namespaces that are relevant on the filesystem with namespaces
      that are relevent on the mount level. Especially for non-vfs developers
      without detailed knowledge in this area this can be a potential source for
      bugs.
      
      Once the conversion to struct mnt_idmap is done all helpers down to the
      really low-level helpers will take a struct mnt_idmap argument instead of
      two namespace arguments. This way it becomes impossible to conflate the two
      eliminating the possibility of any bugs. All of the vfs and all filesystems
      only operate on struct mnt_idmap.
      Acked-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarChristian Brauner (Microsoft) <brauner@kernel.org>
      39f60c1c
    • Christian Brauner's avatar
      fs: port ->permission() to pass mnt_idmap · 4609e1f1
      Christian Brauner authored
      Convert to struct mnt_idmap.
      
      Last cycle we merged the necessary infrastructure in
      256c8aed ("fs: introduce dedicated idmap type for mounts").
      This is just the conversion to struct mnt_idmap.
      
      Currently we still pass around the plain namespace that was attached to a
      mount. This is in general pretty convenient but it makes it easy to
      conflate namespaces that are relevant on the filesystem with namespaces
      that are relevent on the mount level. Especially for non-vfs developers
      without detailed knowledge in this area this can be a potential source for
      bugs.
      
      Once the conversion to struct mnt_idmap is done all helpers down to the
      really low-level helpers will take a struct mnt_idmap argument instead of
      two namespace arguments. This way it becomes impossible to conflate the two
      eliminating the possibility of any bugs. All of the vfs and all filesystems
      only operate on struct mnt_idmap.
      Acked-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarChristian Brauner (Microsoft) <brauner@kernel.org>
      4609e1f1
    • Christian Brauner's avatar
      fs: port ->tmpfile() to pass mnt_idmap · 011e2b71
      Christian Brauner authored
      Convert to struct mnt_idmap.
      
      Last cycle we merged the necessary infrastructure in
      256c8aed ("fs: introduce dedicated idmap type for mounts").
      This is just the conversion to struct mnt_idmap.
      
      Currently we still pass around the plain namespace that was attached to a
      mount. This is in general pretty convenient but it makes it easy to
      conflate namespaces that are relevant on the filesystem with namespaces
      that are relevent on the mount level. Especially for non-vfs developers
      without detailed knowledge in this area this can be a potential source for
      bugs.
      
      Once the conversion to struct mnt_idmap is done all helpers down to the
      really low-level helpers will take a struct mnt_idmap argument instead of
      two namespace arguments. This way it becomes impossible to conflate the two
      eliminating the possibility of any bugs. All of the vfs and all filesystems
      only operate on struct mnt_idmap.
      Acked-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarChristian Brauner (Microsoft) <brauner@kernel.org>
      011e2b71
    • Christian Brauner's avatar
      fs: port ->rename() to pass mnt_idmap · e18275ae
      Christian Brauner authored
      Convert to struct mnt_idmap.
      
      Last cycle we merged the necessary infrastructure in
      256c8aed ("fs: introduce dedicated idmap type for mounts").
      This is just the conversion to struct mnt_idmap.
      
      Currently we still pass around the plain namespace that was attached to a
      mount. This is in general pretty convenient but it makes it easy to
      conflate namespaces that are relevant on the filesystem with namespaces
      that are relevent on the mount level. Especially for non-vfs developers
      without detailed knowledge in this area this can be a potential source for
      bugs.
      
      Once the conversion to struct mnt_idmap is done all helpers down to the
      really low-level helpers will take a struct mnt_idmap argument instead of
      two namespace arguments. This way it becomes impossible to conflate the two
      eliminating the possibility of any bugs. All of the vfs and all filesystems
      only operate on struct mnt_idmap.
      Acked-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarChristian Brauner (Microsoft) <brauner@kernel.org>
      e18275ae
    • Christian Brauner's avatar
      fs: port ->mknod() to pass mnt_idmap · 5ebb29be
      Christian Brauner authored
      Convert to struct mnt_idmap.
      
      Last cycle we merged the necessary infrastructure in
      256c8aed ("fs: introduce dedicated idmap type for mounts").
      This is just the conversion to struct mnt_idmap.
      
      Currently we still pass around the plain namespace that was attached to a
      mount. This is in general pretty convenient but it makes it easy to
      conflate namespaces that are relevant on the filesystem with namespaces
      that are relevent on the mount level. Especially for non-vfs developers
      without detailed knowledge in this area this can be a potential source for
      bugs.
      
      Once the conversion to struct mnt_idmap is done all helpers down to the
      really low-level helpers will take a struct mnt_idmap argument instead of
      two namespace arguments. This way it becomes impossible to conflate the two
      eliminating the possibility of any bugs. All of the vfs and all filesystems
      only operate on struct mnt_idmap.
      Acked-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarChristian Brauner (Microsoft) <brauner@kernel.org>
      5ebb29be
    • Christian Brauner's avatar
      fs: port ->mkdir() to pass mnt_idmap · c54bd91e
      Christian Brauner authored
      Convert to struct mnt_idmap.
      
      Last cycle we merged the necessary infrastructure in
      256c8aed ("fs: introduce dedicated idmap type for mounts").
      This is just the conversion to struct mnt_idmap.
      
      Currently we still pass around the plain namespace that was attached to a
      mount. This is in general pretty convenient but it makes it easy to
      conflate namespaces that are relevant on the filesystem with namespaces
      that are relevent on the mount level. Especially for non-vfs developers
      without detailed knowledge in this area this can be a potential source for
      bugs.
      
      Once the conversion to struct mnt_idmap is done all helpers down to the
      really low-level helpers will take a struct mnt_idmap argument instead of
      two namespace arguments. This way it becomes impossible to conflate the two
      eliminating the possibility of any bugs. All of the vfs and all filesystems
      only operate on struct mnt_idmap.
      Acked-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarChristian Brauner (Microsoft) <brauner@kernel.org>
      c54bd91e
    • Christian Brauner's avatar
      fs: port ->symlink() to pass mnt_idmap · 7a77db95
      Christian Brauner authored
      Convert to struct mnt_idmap.
      
      Last cycle we merged the necessary infrastructure in
      256c8aed ("fs: introduce dedicated idmap type for mounts").
      This is just the conversion to struct mnt_idmap.
      
      Currently we still pass around the plain namespace that was attached to a
      mount. This is in general pretty convenient but it makes it easy to
      conflate namespaces that are relevant on the filesystem with namespaces
      that are relevent on the mount level. Especially for non-vfs developers
      without detailed knowledge in this area this can be a potential source for
      bugs.
      
      Once the conversion to struct mnt_idmap is done all helpers down to the
      really low-level helpers will take a struct mnt_idmap argument instead of
      two namespace arguments. This way it becomes impossible to conflate the two
      eliminating the possibility of any bugs. All of the vfs and all filesystems
      only operate on struct mnt_idmap.
      Acked-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarChristian Brauner (Microsoft) <brauner@kernel.org>
      7a77db95
    • Christian Brauner's avatar
      fs: port ->create() to pass mnt_idmap · 6c960e68
      Christian Brauner authored
      Convert to struct mnt_idmap.
      
      Last cycle we merged the necessary infrastructure in
      256c8aed ("fs: introduce dedicated idmap type for mounts").
      This is just the conversion to struct mnt_idmap.
      
      Currently we still pass around the plain namespace that was attached to a
      mount. This is in general pretty convenient but it makes it easy to
      conflate namespaces that are relevant on the filesystem with namespaces
      that are relevent on the mount level. Especially for non-vfs developers
      without detailed knowledge in this area this can be a potential source for
      bugs.
      
      Once the conversion to struct mnt_idmap is done all helpers down to the
      really low-level helpers will take a struct mnt_idmap argument instead of
      two namespace arguments. This way it becomes impossible to conflate the two
      eliminating the possibility of any bugs. All of the vfs and all filesystems
      only operate on struct mnt_idmap.
      Acked-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarChristian Brauner (Microsoft) <brauner@kernel.org>
      6c960e68
  21. 18 Jan, 2023 1 commit
    • Christian Brauner's avatar
      fs: port vfs_*() helpers to struct mnt_idmap · abf08576
      Christian Brauner authored
      Convert to struct mnt_idmap.
      
      Last cycle we merged the necessary infrastructure in
      256c8aed ("fs: introduce dedicated idmap type for mounts").
      This is just the conversion to struct mnt_idmap.
      
      Currently we still pass around the plain namespace that was attached to a
      mount. This is in general pretty convenient but it makes it easy to
      conflate namespaces that are relevant on the filesystem with namespaces
      that are relevent on the mount level. Especially for non-vfs developers
      without detailed knowledge in this area this can be a potential source for
      bugs.
      
      Once the conversion to struct mnt_idmap is done all helpers down to the
      really low-level helpers will take a struct mnt_idmap argument instead of
      two namespace arguments. This way it becomes impossible to conflate the two
      eliminating the possibility of any bugs. All of the vfs and all filesystems
      only operate on struct mnt_idmap.
      Acked-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarChristian Brauner (Microsoft) <brauner@kernel.org>
      abf08576
  22. 11 Jan, 2023 1 commit