diff options
author | KP Singh <kpsingh@google.com> | 2020-04-30 18:52:40 +0300 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2020-05-01 06:29:34 +0300 |
commit | 54261af473be4c5481f6196064445d2945f2bdab (patch) | |
tree | 2ecf12c8d354b371ac63bae7da0297d90ca4db70 /include/linux/kernel_stat.h | |
parent | c45e8bccecaf633480d378daff11e122dfd5e96d (diff) | |
download | linux-54261af473be4c5481f6196064445d2945f2bdab.tar.xz |
security: Fix the default value of fs_context_parse_param hook
security_fs_context_parse_param is called by vfs_parse_fs_param and
a succussful return value (i.e 0) implies that a parameter will be
consumed by the LSM framework. This stops all further parsing of the
parmeter by VFS. Furthermore, if an LSM hook returns a success, the
remaining LSM hooks are not invoked for the parameter.
The current default behavior of returning success means that all the
parameters are expected to be parsed by the LSM hook and none of them
end up being populated by vfs in fs_context
This was noticed when lsm=bpf is supplied on the command line before any
other LSM. As the bpf lsm uses this default value to implement a default
hook, this resulted in a failure to parse any fs_context parameters and
a failure to mount the root filesystem.
Fixes: 98e828a0650f ("security: Refactor declaration of LSM hooks")
Reported-by: Mikko Ylinen <mikko.ylinen@linux.intel.com>
Signed-off-by: KP Singh <kpsingh@google.com>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'include/linux/kernel_stat.h')
0 files changed, 0 insertions, 0 deletions