History

security: Fix security_old_inode_init_security() when CONFIG_SECURITY is not set

Commit 1e39f384bb01 ("evm: fix build problems") makes the stub version of security_old_inode_init_security() return 0 when CONFIG_SECURITY is not set. But that makes callers such as reiserfs_security_init() assume that security_old_inode_init_security() has set name, value, and len arguments properly - but security_old_inode_init_security() left them uninitialized which then results in interesting failures. Revert security_old_inode_init_security() to the old behavior of returning EOPNOTSUPP since both callers (reiserfs and ocfs2) handle this just fine. [ Also fixed the S_PRIVATE(inode) case of the actual non-stub security_old_inode_init_security() function to return EOPNOTSUPP for the same reason, as pointed out by Mimi Zohar. It got incorrectly changed to match the new function in commit fb88c2b6cbb1: "evm: fix security/security_old_init_security return code". - Linus ]

Jan Kara committed 14 years ago

Commit 30e05321 parent 4376eee2 files · +2 −2Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/security.h+1−1
@@ -2056,7 +2056,7 @@ static inline int security_old_inode_init_security(struct inode *inode, · 2055 unmodified lines
20562056 char **name, void **value,
20572057 size_t *len)
20582058 {
2059− return 0;
2059+ return -EOPNOTSUPP;
20602060 }
20612061
20622062 static inline int security_inode_create(struct inode *dir,