Skip to content
Snippets Groups Projects
Commit 23e390cd authored by KP Singh's avatar KP Singh Committed by James Morris
Browse files

security: Fix hook iteration and default value for inode_copy_up_xattr


inode_copy_up_xattr returns 0 to indicate the acceptance of the xattr
and 1 to reject it. If the LSM does not know about the xattr, it's
expected to return -EOPNOTSUPP, which is the correct default value for
this hook. BPF LSM, currently, uses 0 as the default value and thereby
falsely allows all overlay fs xattributes to be copied up.

The iteration logic is also updated from the "bail-on-fail"
call_int_hook to continue on the non-decisive -EOPNOTSUPP and bail out
on other values.

Fixes: 98e828a0 ("security: Refactor declaration of LSM hooks")
Signed-off-by: default avatarKP Singh <kpsingh@google.com>
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
parent 4bc799dc
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment