UPSTREAM: security: add inode_init_security_anon() LSM hook
This change adds a new LSM hook, inode_init_security_anon(), that will be used while creating secure anonymous inodes. The hook allows/denies its creation and assigns a security context to the inode. The new hook accepts an optional context_inode parameter that callers can use to provide additional contextual information to security modules for granting/denying permission to create an anon-inode of the same type. This context_inode's security_context can also be used to initialize the newly created anon-inode's security_context. Signed-off-by: Lokesh Gidra <lokeshgidra@google.com> Reviewed-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Paul Moore <paul@paul-moore.com> (cherry picked from commit 215b674b84dd052098fe6389e32a5afaff8b4d56) Signed-off-by: Lokesh Gidra <lokeshgidra@google.com> Bug: 160737021 Bug: 169683130 Change-Id: I2bbbb7a5c2371103c5b632b791c5c397ae228e0b
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
865fd5429d
commit
4e8b67477e
@@ -113,6 +113,8 @@ LSM_HOOK(void, LSM_RET_VOID, inode_free_security, struct inode *inode)
|
||||
LSM_HOOK(int, 0, inode_init_security, struct inode *inode,
|
||||
struct inode *dir, const struct qstr *qstr, const char **name,
|
||||
void **value, size_t *len)
|
||||
LSM_HOOK(int, 0, inode_init_security_anon, struct inode *inode,
|
||||
const struct qstr *name, const struct inode *context_inode)
|
||||
LSM_HOOK(int, 0, inode_create, struct inode *dir, struct dentry *dentry,
|
||||
umode_t mode)
|
||||
LSM_HOOK(int, 0, inode_link, struct dentry *old_dentry, struct inode *dir,
|
||||
|
Reference in New Issue
Block a user