mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 22:37:45 -04:00
aa_xattrs_match() is unfortunately calling vfs_getxattr_alloc() from a
context protected by an rcu_read_lock. This can not be done as
vfs_getxattr_alloc() may sleep regardles of the gfp_t value being
passed to it.
Fix this by breaking the rcu_read_lock on the policy search when the
xattr match feature is requested and restarting the search if a policy
changes occur.
Fixes: 8e51f9087f ("apparmor: Add support for attaching profiles via xattr, presence and value")
Reported-by: Jia-Ju Bai <[email protected]>
Reported-by: Al Viro <[email protected]>
Signed-off-by: John Johansen <[email protected]>