mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
mask off MAX_EXEC checks for directories in inode_permission
This commit is contained in:
parent
1bd96a3266
commit
b7308dda2a
1 changed files with 22 additions and 0 deletions
22
kernel-patches/for-mainline/fix_leaf.diff
Normal file
22
kernel-patches/for-mainline/fix_leaf.diff
Normal file
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
security/apparmor/lsm.c | 8 +++++---
|
||||
1 file changed, 5 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/security/apparmor/lsm.c
|
||||
+++ b/security/apparmor/lsm.c
|
||||
@@ -380,10 +380,12 @@ static int apparmor_inode_permission(str
|
||||
|
||||
if (!nd || nd->flags & (LOOKUP_PARENT | LOOKUP_CONTINUE))
|
||||
return 0;
|
||||
- if (S_ISDIR(inode->i_mode))
|
||||
- check |= AA_CHECK_DIR;
|
||||
mask &= (MAY_READ | MAY_WRITE | MAY_EXEC);
|
||||
-
|
||||
+ if (S_ISDIR(inode->i_mode)) {
|
||||
+ check |= AA_CHECK_DIR;
|
||||
+ /* allow traverse accesses to directories */
|
||||
+ mask &= ~MAY_EXEC;
|
||||
+ }
|
||||
return aa_permission(inode, nd->dentry, nd->mnt, mask, check);
|
||||
}
|
||||
|
Loading…
Add table
Reference in a new issue