blob: d404329e5eeb7dceb3aa46191e12ff6d4e9e9e1c [file] [log] [blame]
Casey Schauflerd3d929a2023-09-12 13:56:56 -07001/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Linux Security Module infrastructure tests
4 *
5 * Copyright © 2023 Casey Schaufler <casey@schaufler-ca.com>
6 */
7
8#ifndef lsm_get_self_attr
9static inline int lsm_get_self_attr(unsigned int attr, struct lsm_ctx *ctx,
10 size_t *size, __u32 flags)
11{
12 return syscall(__NR_lsm_get_self_attr, attr, ctx, size, flags);
13}
14#endif
15
16#ifndef lsm_set_self_attr
17static inline int lsm_set_self_attr(unsigned int attr, struct lsm_ctx *ctx,
18 size_t size, __u32 flags)
19{
20 return syscall(__NR_lsm_set_self_attr, attr, ctx, size, flags);
21}
22#endif
23
24#ifndef lsm_list_modules
25static inline int lsm_list_modules(__u64 *ids, size_t *size, __u32 flags)
26{
27 return syscall(__NR_lsm_list_modules, ids, size, flags);
28}
29#endif
30
31extern int read_proc_attr(const char *attr, char *value, size_t size);
32extern int read_sysfs_lsms(char *lsms, size_t size);
33int attr_lsm_count(void);