| 1 | |
| 2 | |
| 3 | * LSM functions
|
| 4 |
|
| 5 |
|
| 6 | #ifndef _LSM_H_
|
| 7 | #define _LSM_H_
|
| 8 |
|
| 9 | #include <linux/printk.h>
|
| 10 | #include <linux/lsm_hooks.h>
|
| 11 | #include <linux/lsm_count.h>
|
| 12 |
|
| 13 |
|
| 14 | extern bool lsm_debug;
|
| 15 | #define lsm_pr(...) pr_info(__VA_ARGS__)
|
| 16 | #define lsm_pr_cont(...) pr_cont(__VA_ARGS__)
|
| 17 | #define lsm_pr_dbg(...) \
|
| 18 | do { \
|
| 19 | if (lsm_debug) \
|
| 20 | pr_info(__VA_ARGS__); \
|
| 21 | } while (0)
|
| 22 |
|
| 23 |
|
| 24 | extern unsigned int lsm_active_cnt;
|
| 25 | extern const struct lsm_id *lsm_idlist[];
|
| 26 |
|
| 27 |
|
| 28 | extern struct lsm_blob_sizes blob_sizes;
|
| 29 |
|
| 30 |
|
| 31 | extern struct kmem_cache *lsm_file_cache;
|
| 32 | extern struct kmem_cache *lsm_backing_file_cache;
|
| 33 | extern struct kmem_cache *lsm_inode_cache;
|
| 34 |
|
| 35 |
|
| 36 | int lsm_cred_alloc(struct cred *cred, gfp_t gfp);
|
| 37 | int lsm_task_alloc(struct task_struct *task);
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 | #ifdef CONFIG_SECURITYFS
|
| 42 | int securityfs_init(void);
|
| 43 | #else
|
| 44 | static inline int securityfs_init(void)
|
| 45 | {
|
| 46 | return 0;
|
| 47 | }
|
| 48 | #endif
|
| 49 |
|
| 50 | #endif
|