]> git.ipfire.org Git - thirdparty/linux.git/commit
fs: rework listmount() implementation
authorChristian Brauner <brauner@kernel.org>
Fri, 12 Jan 2024 08:09:14 +0000 (09:09 +0100)
committerChristian Brauner <brauner@kernel.org>
Sat, 13 Jan 2024 12:06:25 +0000 (13:06 +0100)
commitba5afb9a84df2e6b26a1b6389b98849cd16ea757
tree5829dd309fc8910ff586e6fda90b07d09ca9962f
parent7ea26f9460c6c76b1d6e36f39fce34b16cb88300
fs: rework listmount() implementation

Linus pointed out that there's error handling and naming issues in the
that we should rewrite:

* Perform the access checks for the buffer before actually doing any
  work instead of doing it during the iteration.
* Rename the arguments to listmount() and do_listmount() to clarify what
  the arguments are used for.
* Get rid of the pointless ctr variable and overflow checking.
* Get rid of the pointless speculation check.

Link: https://lore.kernel.org/r/CAHk-=wjh6Cypo8WC-McXgSzCaou3UXccxB+7PVeSuGR8AjCphg@mail.gmail.com
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/namespace.c
include/linux/syscalls.h