Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit caefc016 authored by James Morris's avatar James Morris Committed by Olav Haugan
Browse files

security: mark LSM hooks as __ro_after_init



Mark all of the registration hooks as __ro_after_init (via the
__lsm_ro_after_init macro).

Change-Id: I07d4286051373aac1e76442afc7ca8fab3065b60
Signed-off-by: default avatarJames Morris <james.l.morris@oracle.com>
Acked-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
Acked-by: default avatarKees Cook <keescook@chromium.org>
Git-commit: ca97d939db114c8d1619e10a3b82af8615372dae
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


Signed-off-by: default avatarOlav Haugan <ohaugan@codeaurora.org>
parent 45351056
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -584,7 +584,7 @@ static int apparmor_task_setrlimit(struct task_struct *task,
	return error;
}

static struct security_hook_list apparmor_hooks[] = {
static struct security_hook_list apparmor_hooks[] __lsm_ro_after_init = {
	LSM_HOOK_INIT(ptrace_access_check, apparmor_ptrace_access_check),
	LSM_HOOK_INIT(ptrace_traceme, apparmor_ptrace_traceme),
	LSM_HOOK_INIT(capget, apparmor_capget),
+1 −1
Original line number Diff line number Diff line
@@ -1081,7 +1081,7 @@ int cap_mmap_file(struct file *file, unsigned long reqprot,

#ifdef CONFIG_SECURITY

struct security_hook_list capability_hooks[] = {
struct security_hook_list capability_hooks[] __lsm_ro_after_init = {
	LSM_HOOK_INIT(capable, cap_capable),
	LSM_HOOK_INIT(settime, cap_settime),
	LSM_HOOK_INIT(ptrace_access_check, cap_ptrace_access_check),
+1 −1
Original line number Diff line number Diff line
@@ -174,7 +174,7 @@ static int loadpin_read_file(struct file *file, enum kernel_read_file_id id)
	return 0;
}

static struct security_hook_list loadpin_hooks[] = {
static struct security_hook_list loadpin_hooks[] __lsm_ro_after_init = {
	LSM_HOOK_INIT(sb_free_security, loadpin_sb_free_security),
	LSM_HOOK_INIT(kernel_read_file, loadpin_read_file),
};
+1 −1
Original line number Diff line number Diff line
@@ -1590,7 +1590,7 @@ int security_audit_rule_match(u32 secid, u32 field, u32 op, void *lsmrule,
}
#endif /* CONFIG_AUDIT */

struct security_hook_heads security_hook_heads = {
struct security_hook_heads security_hook_heads __lsm_ro_after_init = {
	.binder_set_context_mgr =
		LIST_HEAD_INIT(security_hook_heads.binder_set_context_mgr),
	.binder_transaction =
+1 −1
Original line number Diff line number Diff line
@@ -6079,7 +6079,7 @@ static int selinux_key_getsecurity(struct key *key, char **_buffer)

#endif

static struct security_hook_list selinux_hooks[] = {
static struct security_hook_list selinux_hooks[] __lsm_ro_after_init = {
	LSM_HOOK_INIT(binder_set_context_mgr, selinux_binder_set_context_mgr),
	LSM_HOOK_INIT(binder_transaction, selinux_binder_transaction),
	LSM_HOOK_INIT(binder_transfer_binder, selinux_binder_transfer_binder),
Loading