]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
cachefiles: use vfs_tmpfile_open() helper
authorMiklos Szeredi <mszeredi@redhat.com>
Sat, 24 Sep 2022 05:00:00 +0000 (07:00 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Sat, 24 Sep 2022 05:00:00 +0000 (07:00 +0200)
commit24a81759b65fa85767739999d91523691c5e2ea5
tree638877e35b62d14abe285982850d1b54d7a58624
parent08d7a6fb7e44ae0f54f7903888dc41e31dfbc9da
cachefiles: use vfs_tmpfile_open() helper

Use the vfs_tmpfile_open() helper instead of doing tmpfile creation and
opening separately.

The only minor difference is that previously no permission checking was
done, while vfs_tmpfile_open() will call may_open() with zero access mask
(i.e. no access is checked).  Even if this would make a difference with
callers caps (don't see how it could, even in the LSM codepaths) cachfiles
raises caps before performing the tmpfile creation, so this extra
permission check will not result in any regression.

Reviewed-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/cachefiles/namei.c