]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerPaolo Pisati <paolo.pisati@canonical.com>
Mon, 7 Mar 2022 10:46:02 +0000 (11:46 +0100)
commit7912f9b758b849e4398af0475fe76980569609ab
tree22ea1c4da74abb8e316a28d2bc6923b6a3fd5c5b
parent4cdc3d8d1a891e14646d3fe8966aba1074693e10
tracefs: Set the group ownership in apply_options() not parse_options()

BugLink: https://bugs.launchpad.net/bugs/1963891
commit 851e99ebeec3f4a672bb5010cf1ece095acee447 upstream.

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: 48b27b6b5191 ("tracefs: Set all files to the same group ownership as the mount option")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
fs/tracefs/inode.c