aboutsummaryrefslogtreecommitdiff
path: root/include/linux/lsm_hooks.h
AgeCommit message (Collapse)AuthorFilesLines
2015-05-12LSM: Switch to lists of hooksCasey Schaufler1-24/+53
Instead of using a vector of security operations with explicit, special case stacking of the capability and yama hooks use lists of hooks with capability and yama hooks included as appropriate. The security_operations structure is no longer required. Instead, there is a union of the function pointers that allows all the hooks lists to use a common mechanism for list management while retaining typing. Each module supplies an array describing the hooks it provides instead of a sparsely populated security_operations structure. The description includes the element that gets put on the hook list, avoiding the issues surrounding individual element allocation. The method for registering security modules is changed to reflect the information available. The method for removing a module, currently only used by SELinux, has also changed. It should be generic now, however if there are potential race conditions based on ordering of hook removal that needs to be addressed by the calling module. The security hooks are called from the lists and the first failure is returned. Signed-off-by: Casey Schaufler <[email protected]> Acked-by: John Johansen <[email protected]> Acked-by: Kees Cook <[email protected]> Acked-by: Paul Moore <[email protected]> Acked-by: Stephen Smalley <[email protected]> Acked-by: Tetsuo Handa <[email protected]> Signed-off-by: James Morris <[email protected]>
2015-05-12LSM: Add security module hook list headsCasey Schaufler1-0/+220
Add a list header for each security hook. They aren't used until later in the patch series. They are grouped together in a structure so that there doesn't need to be an external address for each. Macro-ize the initialization of the security_operations for each security module in anticipation of changing out the security_operations structure. Signed-off-by: Casey Schaufler <[email protected]> Acked-by: John Johansen <[email protected]> Acked-by: Kees Cook <[email protected]> Acked-by: Paul Moore <[email protected]> Acked-by: Stephen Smalley <[email protected]> Acked-by: Tetsuo Handa <[email protected]> Signed-off-by: James Morris <[email protected]>
2015-05-12LSM: Add the comment to lsm_hooks.hCasey Schaufler1-0/+1279
Add the large comment describing the content of the security_operations structure to lsm_hooks.h. This wasn't done in the previous (1/7) patch because it would have exceeded the mail list size limits. Signed-off-by: Casey Schaufler <[email protected]> Acked-by: John Johansen <[email protected]> Acked-by: Kees Cook <[email protected]> Acked-by: Paul Moore <[email protected]> Acked-by: Stephen Smalley <[email protected]> Acked-by: Tetsuo Handa <[email protected]> Signed-off-by: James Morris <[email protected]>
2015-05-12LSM: Split security.hCasey Schaufler1-0/+358
The security.h header file serves two purposes, interfaces for users of the security modules and interfaces for security modules. Users of the security modules don't need to know about what's in the security_operations structure, so pull it out into it's own header, lsm_hooks.h Signed-off-by: Casey Schaufler <[email protected]> Acked-by: John Johansen <[email protected]> Acked-by: Kees Cook <[email protected]> Acked-by: Paul Moore <[email protected]> Acked-by: Stephen Smalley <[email protected]> Acked-by: Tetsuo Handa <[email protected]> Signed-off-by: James Morris <[email protected]>