]> git.baikalelectronics.ru Git - kernel.git/commit
tracefs: Set the group ownership in apply_options() not parse_options()
authorSteven Rostedt (Google) <rostedt@goodmis.org>
Fri, 25 Feb 2022 20:34:26 +0000 (15:34 -0500)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Sat, 26 Feb 2022 02:05:04 +0000 (21:05 -0500)
commitd961449934c131ab13a5ba89e29a72796e1e85fc
treed8e8f5a9243e08cdc546d63d4dfdaad5e7e26cf4
parentbe0a37194134e398ec1e56dbf304b37c5f104042
tracefs: Set the group ownership in apply_options() not parse_options()

Al Viro brought it to my attention that the dentries may not be filled
when the parse_options() is called, causing the call to set_gid() to
possibly crash. It should only be called if parse_options() succeeds
totally anyway.

He suggested the logical place to do the update is in apply_options().

Link: https://lore.kernel.org/all/20220225165219.737025658@goodmis.org/
Link: https://lkml.kernel.org/r/20220225153426.1c4cab6b@gandalf.local.home
Cc: stable@vger.kernel.org
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Fixes: e06c3c3914b2 ("tracefs: Set all files to the same group ownership as the mount option")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
fs/tracefs/inode.c