]> git.baikalelectronics.ru Git - kernel.git/commit
fs: Add missing umask strip in vfs_tmpfile
authorYang Xu <xuyang2018.jy@fujitsu.com>
Thu, 14 Jul 2022 06:11:26 +0000 (14:11 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 09:17:22 +0000 (11:17 +0200)
commite83873f7a14c318f236cbe459134d55af7d66790
tree27c18fc71688ff7c4aa35e2d3b63780c6d8407a1
parentf7a9d58deff4a243c021a4dd2c63ac83a60151fe
fs: Add missing umask strip in vfs_tmpfile

commit d664b8b3609bea980232d00356bfc348350b8093 upstream.

All creation paths except for O_TMPFILE handle umask in the vfs directly
if the filesystem doesn't support or enable POSIX ACLs. If the filesystem
does then umask handling is deferred until posix_acl_create().
Because, O_TMPFILE misses umask handling in the vfs it will not honor
umask settings. Fix this by adding the missing umask handling.

Link: https://lore.kernel.org/r/1657779088-2242-2-git-send-email-xuyang2018.jy@fujitsu.com
Fixes: ef81791ba709 ("[O_TMPFILE] it's still short a few helpers, but infrastructure should be OK now...")
Cc: <stable@vger.kernel.org> # 4.19+
Reported-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-and-Tested-by: Jeff Layton <jlayton@kernel.org>
Acked-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/namei.c