lsm_hooks.h (db6da59cf27b5661ced03754ae0550f8914eda9e) lsm_hooks.h (6bcdfd2cac5559c680aef8dd4c5facada55ab623)
1/*
2 * Linux Security Module interfaces
3 *
4 * Copyright (C) 2001 WireX Communications, Inc <chris@wirex.com>
5 * Copyright (C) 2001 Greg Kroah-Hartman <greg@kroah.com>
6 * Copyright (C) 2001 Networks Associates Technology, Inc <ssmalley@nai.com>
7 * Copyright (C) 2001 James Morris <jmorris@intercode.com.au>
8 * Copyright (C) 2001 Silicon Graphics, Inc. (Trust Technology Group)

--- 14 unchanged lines hidden (view full) ---

23 */
24
25#ifndef __LINUX_LSM_HOOKS_H
26#define __LINUX_LSM_HOOKS_H
27
28#include <linux/security.h>
29#include <linux/init.h>
30#include <linux/rculist.h>
1/*
2 * Linux Security Module interfaces
3 *
4 * Copyright (C) 2001 WireX Communications, Inc <chris@wirex.com>
5 * Copyright (C) 2001 Greg Kroah-Hartman <greg@kroah.com>
6 * Copyright (C) 2001 Networks Associates Technology, Inc <ssmalley@nai.com>
7 * Copyright (C) 2001 James Morris <jmorris@intercode.com.au>
8 * Copyright (C) 2001 Silicon Graphics, Inc. (Trust Technology Group)

--- 14 unchanged lines hidden (view full) ---

23 */
24
25#ifndef __LINUX_LSM_HOOKS_H
26#define __LINUX_LSM_HOOKS_H
27
28#include <linux/security.h>
29#include <linux/init.h>
30#include <linux/rculist.h>
31#include <linux/xattr.h>
31
32union security_list_options {
33 #define LSM_HOOK(RET, DEFAULT, NAME, ...) RET (*NAME)(__VA_ARGS__);
34 #include "lsm_hook_defs.h"
35 #undef LSM_HOOK
36};
37
38struct security_hook_heads {

--- 19 unchanged lines hidden (view full) ---

58struct lsm_blob_sizes {
59 int lbs_cred;
60 int lbs_file;
61 int lbs_inode;
62 int lbs_superblock;
63 int lbs_ipc;
64 int lbs_msg_msg;
65 int lbs_task;
32
33union security_list_options {
34 #define LSM_HOOK(RET, DEFAULT, NAME, ...) RET (*NAME)(__VA_ARGS__);
35 #include "lsm_hook_defs.h"
36 #undef LSM_HOOK
37};
38
39struct security_hook_heads {

--- 19 unchanged lines hidden (view full) ---

59struct lsm_blob_sizes {
60 int lbs_cred;
61 int lbs_file;
62 int lbs_inode;
63 int lbs_superblock;
64 int lbs_ipc;
65 int lbs_msg_msg;
66 int lbs_task;
67 int lbs_xattr_count; /* number of xattr slots in new_xattrs array */
66};
67
68};
69
70/**
71 * lsm_get_xattr_slot - Return the next available slot and increment the index
72 * @xattrs: array storing LSM-provided xattrs
73 * @xattr_count: number of already stored xattrs (updated)
74 *
75 * Retrieve the first available slot in the @xattrs array to fill with an xattr,
76 * and increment @xattr_count.
77 *
78 * Return: The slot to fill in @xattrs if non-NULL, NULL otherwise.
79 */
80static inline struct xattr *lsm_get_xattr_slot(struct xattr *xattrs,
81 int *xattr_count)
82{
83 if (unlikely(!xattrs))
84 return NULL;
85 return &xattrs[(*xattr_count)++];
86}
87
68/*
69 * LSM_RET_VOID is used as the default value in LSM_HOOK definitions for void
70 * LSM hooks (in include/linux/lsm_hook_defs.h).
71 */
72#define LSM_RET_VOID ((void) 0)
73
74/*
75 * Initializing a security_hook_list structure takes

--- 47 unchanged lines hidden ---
88/*
89 * LSM_RET_VOID is used as the default value in LSM_HOOK definitions for void
90 * LSM hooks (in include/linux/lsm_hook_defs.h).
91 */
92#define LSM_RET_VOID ((void) 0)
93
94/*
95 * Initializing a security_hook_list structure takes

--- 47 unchanged lines hidden ---