1 /* SPDX-License-Identifier: GPL-2.0 */ 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 2 /* 3 * Linux Security Module infrastructure tests 3 * Linux Security Module infrastructure tests 4 * 4 * 5 * Copyright © 2023 Casey Schaufler <casey@sc 5 * Copyright © 2023 Casey Schaufler <casey@schaufler-ca.com> 6 */ 6 */ 7 7 8 #ifndef lsm_get_self_attr 8 #ifndef lsm_get_self_attr 9 static inline int lsm_get_self_attr(unsigned i 9 static inline int lsm_get_self_attr(unsigned int attr, struct lsm_ctx *ctx, 10 __u32 *siz 10 __u32 *size, __u32 flags) 11 { 11 { 12 return syscall(__NR_lsm_get_self_attr, 12 return syscall(__NR_lsm_get_self_attr, attr, ctx, size, flags); 13 } 13 } 14 #endif 14 #endif 15 15 16 #ifndef lsm_set_self_attr 16 #ifndef lsm_set_self_attr 17 static inline int lsm_set_self_attr(unsigned i 17 static inline int lsm_set_self_attr(unsigned int attr, struct lsm_ctx *ctx, 18 __u32 size 18 __u32 size, __u32 flags) 19 { 19 { 20 return syscall(__NR_lsm_set_self_attr, 20 return syscall(__NR_lsm_set_self_attr, attr, ctx, size, flags); 21 } 21 } 22 #endif 22 #endif 23 23 24 #ifndef lsm_list_modules 24 #ifndef lsm_list_modules 25 static inline int lsm_list_modules(__u64 *ids, 25 static inline int lsm_list_modules(__u64 *ids, __u32 *size, __u32 flags) 26 { 26 { 27 return syscall(__NR_lsm_list_modules, 27 return syscall(__NR_lsm_list_modules, ids, size, flags); 28 } 28 } 29 #endif 29 #endif 30 30 31 extern int read_proc_attr(const char *attr, ch 31 extern int read_proc_attr(const char *attr, char *value, size_t size); 32 extern int read_sysfs_lsms(char *lsms, size_t 32 extern int read_sysfs_lsms(char *lsms, size_t size); 33 int attr_lsm_count(void); 33 int attr_lsm_count(void); 34 34
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.