Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selinux: remove 'flags' parameter from inode_has_perm

Every single user passes in '0'. I think we had non-zero users back in
some stone age when selinux_inode_permission() was implemented in terms
of inode_has_perm(), but that complicated case got split up into a
totally separate code-path so that we could optimize the much simpler
special cases.

See commit 2e33405785d3 ("SELinux: delay initialization of audit data in
selinux_inode_permission") for example.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

+6 -7
+6 -7
security/selinux/hooks.c
··· 1525 1525 static int inode_has_perm(const struct cred *cred, 1526 1526 struct inode *inode, 1527 1527 u32 perms, 1528 - struct common_audit_data *adp, 1529 - unsigned flags) 1528 + struct common_audit_data *adp) 1530 1529 { 1531 1530 struct inode_security_struct *isec; 1532 1531 u32 sid; ··· 1538 1539 sid = cred_sid(cred); 1539 1540 isec = inode->i_security; 1540 1541 1541 - return avc_has_perm_flags(sid, isec->sid, isec->sclass, perms, adp, flags); 1542 + return avc_has_perm(sid, isec->sid, isec->sclass, perms, adp); 1542 1543 } 1543 1544 1544 1545 /* Same as inode_has_perm, but pass explicit audit data containing ··· 1553 1554 1554 1555 ad.type = LSM_AUDIT_DATA_DENTRY; 1555 1556 ad.u.dentry = dentry; 1556 - return inode_has_perm(cred, inode, av, &ad, 0); 1557 + return inode_has_perm(cred, inode, av, &ad); 1557 1558 } 1558 1559 1559 1560 /* Same as inode_has_perm, but pass explicit audit data containing ··· 1568 1569 1569 1570 ad.type = LSM_AUDIT_DATA_PATH; 1570 1571 ad.u.path = *path; 1571 - return inode_has_perm(cred, inode, av, &ad, 0); 1572 + return inode_has_perm(cred, inode, av, &ad); 1572 1573 } 1573 1574 1574 1575 /* Same as path_has_perm, but uses the inode from the file struct. */ ··· 1580 1581 1581 1582 ad.type = LSM_AUDIT_DATA_PATH; 1582 1583 ad.u.path = file->f_path; 1583 - return inode_has_perm(cred, file_inode(file), av, &ad, 0); 1584 + return inode_has_perm(cred, file_inode(file), av, &ad); 1584 1585 } 1585 1586 1586 1587 /* Check whether a task can use an open file descriptor to ··· 1616 1617 /* av is zero if only checking access to the descriptor. */ 1617 1618 rc = 0; 1618 1619 if (av) 1619 - rc = inode_has_perm(cred, inode, av, &ad, 0); 1620 + rc = inode_has_perm(cred, inode, av, &ad); 1620 1621 1621 1622 out: 1622 1623 return rc;