xref: /openbmc/linux/security/yama/yama_lsm.c (revision 235e7527)
12d514487SKees Cook /*
22d514487SKees Cook  * Yama Linux Security Module
32d514487SKees Cook  *
42d514487SKees Cook  * Author: Kees Cook <keescook@chromium.org>
52d514487SKees Cook  *
62d514487SKees Cook  * Copyright (C) 2010 Canonical, Ltd.
72d514487SKees Cook  * Copyright (C) 2011 The Chromium OS Authors.
82d514487SKees Cook  *
92d514487SKees Cook  * This program is free software; you can redistribute it and/or modify
102d514487SKees Cook  * it under the terms of the GNU General Public License version 2, as
112d514487SKees Cook  * published by the Free Software Foundation.
122d514487SKees Cook  *
132d514487SKees Cook  */
142d514487SKees Cook 
152d514487SKees Cook #include <linux/security.h>
162d514487SKees Cook #include <linux/sysctl.h>
172d514487SKees Cook #include <linux/ptrace.h>
182d514487SKees Cook #include <linux/prctl.h>
192d514487SKees Cook #include <linux/ratelimit.h>
20235e7527SKees Cook #include <linux/workqueue.h>
212d514487SKees Cook 
22389da25fSKees Cook #define YAMA_SCOPE_DISABLED	0
23389da25fSKees Cook #define YAMA_SCOPE_RELATIONAL	1
24389da25fSKees Cook #define YAMA_SCOPE_CAPABILITY	2
25389da25fSKees Cook #define YAMA_SCOPE_NO_ATTACH	3
26389da25fSKees Cook 
27389da25fSKees Cook static int ptrace_scope = YAMA_SCOPE_RELATIONAL;
282d514487SKees Cook 
292d514487SKees Cook /* describe a ptrace relationship for potential exception */
302d514487SKees Cook struct ptrace_relation {
312d514487SKees Cook 	struct task_struct *tracer;
322d514487SKees Cook 	struct task_struct *tracee;
33235e7527SKees Cook 	bool invalid;
342d514487SKees Cook 	struct list_head node;
3593b69d43SKees Cook 	struct rcu_head rcu;
362d514487SKees Cook };
372d514487SKees Cook 
382d514487SKees Cook static LIST_HEAD(ptracer_relations);
392d514487SKees Cook static DEFINE_SPINLOCK(ptracer_relations_lock);
402d514487SKees Cook 
41235e7527SKees Cook static void yama_relation_cleanup(struct work_struct *work);
42235e7527SKees Cook static DECLARE_WORK(yama_relation_work, yama_relation_cleanup);
43235e7527SKees Cook 
44235e7527SKees Cook /**
45235e7527SKees Cook  * yama_relation_cleanup - remove invalid entries from the relation list
46235e7527SKees Cook  *
47235e7527SKees Cook  */
48235e7527SKees Cook static void yama_relation_cleanup(struct work_struct *work)
49235e7527SKees Cook {
50235e7527SKees Cook 	struct ptrace_relation *relation;
51235e7527SKees Cook 
52235e7527SKees Cook 	spin_lock(&ptracer_relations_lock);
53235e7527SKees Cook 	rcu_read_lock();
54235e7527SKees Cook 	list_for_each_entry_rcu(relation, &ptracer_relations, node) {
55235e7527SKees Cook 		if (relation->invalid) {
56235e7527SKees Cook 			list_del_rcu(&relation->node);
57235e7527SKees Cook 			kfree_rcu(relation, rcu);
58235e7527SKees Cook 		}
59235e7527SKees Cook 	}
60235e7527SKees Cook 	rcu_read_unlock();
61235e7527SKees Cook 	spin_unlock(&ptracer_relations_lock);
62235e7527SKees Cook }
63235e7527SKees Cook 
642d514487SKees Cook /**
652d514487SKees Cook  * yama_ptracer_add - add/replace an exception for this tracer/tracee pair
662d514487SKees Cook  * @tracer: the task_struct of the process doing the ptrace
672d514487SKees Cook  * @tracee: the task_struct of the process to be ptraced
682d514487SKees Cook  *
692d514487SKees Cook  * Each tracee can have, at most, one tracer registered. Each time this
702d514487SKees Cook  * is called, the prior registered tracer will be replaced for the tracee.
712d514487SKees Cook  *
722d514487SKees Cook  * Returns 0 if relationship was added, -ve on error.
732d514487SKees Cook  */
742d514487SKees Cook static int yama_ptracer_add(struct task_struct *tracer,
752d514487SKees Cook 			    struct task_struct *tracee)
762d514487SKees Cook {
7793b69d43SKees Cook 	struct ptrace_relation *relation, *added;
782d514487SKees Cook 
792d514487SKees Cook 	added = kmalloc(sizeof(*added), GFP_KERNEL);
802d514487SKees Cook 	if (!added)
812d514487SKees Cook 		return -ENOMEM;
822d514487SKees Cook 
8393b69d43SKees Cook 	added->tracee = tracee;
8493b69d43SKees Cook 	added->tracer = tracer;
85235e7527SKees Cook 	added->invalid = false;
8693b69d43SKees Cook 
87235e7527SKees Cook 	spin_lock(&ptracer_relations_lock);
8893b69d43SKees Cook 	rcu_read_lock();
8993b69d43SKees Cook 	list_for_each_entry_rcu(relation, &ptracer_relations, node) {
90235e7527SKees Cook 		if (relation->invalid)
91235e7527SKees Cook 			continue;
9293b69d43SKees Cook 		if (relation->tracee == tracee) {
9393b69d43SKees Cook 			list_replace_rcu(&relation->node, &added->node);
9493b69d43SKees Cook 			kfree_rcu(relation, rcu);
9593b69d43SKees Cook 			goto out;
962d514487SKees Cook 		}
972d514487SKees Cook 	}
982d514487SKees Cook 
9993b69d43SKees Cook 	list_add_rcu(&added->node, &ptracer_relations);
10093b69d43SKees Cook 
10193b69d43SKees Cook out:
10293b69d43SKees Cook 	rcu_read_unlock();
103235e7527SKees Cook 	spin_unlock(&ptracer_relations_lock);
10493b69d43SKees Cook 	return 0;
1052d514487SKees Cook }
1062d514487SKees Cook 
1072d514487SKees Cook /**
1082d514487SKees Cook  * yama_ptracer_del - remove exceptions related to the given tasks
1092d514487SKees Cook  * @tracer: remove any relation where tracer task matches
1102d514487SKees Cook  * @tracee: remove any relation where tracee task matches
1112d514487SKees Cook  */
1122d514487SKees Cook static void yama_ptracer_del(struct task_struct *tracer,
1132d514487SKees Cook 			     struct task_struct *tracee)
1142d514487SKees Cook {
11593b69d43SKees Cook 	struct ptrace_relation *relation;
116235e7527SKees Cook 	bool marked = false;
1172d514487SKees Cook 
11893b69d43SKees Cook 	rcu_read_lock();
11993b69d43SKees Cook 	list_for_each_entry_rcu(relation, &ptracer_relations, node) {
120235e7527SKees Cook 		if (relation->invalid)
121235e7527SKees Cook 			continue;
1222d514487SKees Cook 		if (relation->tracee == tracee ||
123bf06189eSKees Cook 		    (tracer && relation->tracer == tracer)) {
124235e7527SKees Cook 			relation->invalid = true;
125235e7527SKees Cook 			marked = true;
1262d514487SKees Cook 		}
12793b69d43SKees Cook 	}
12893b69d43SKees Cook 	rcu_read_unlock();
129235e7527SKees Cook 
130235e7527SKees Cook 	if (marked)
131235e7527SKees Cook 		schedule_work(&yama_relation_work);
1322d514487SKees Cook }
1332d514487SKees Cook 
1342d514487SKees Cook /**
1352d514487SKees Cook  * yama_task_free - check for task_pid to remove from exception list
1362d514487SKees Cook  * @task: task being removed
1372d514487SKees Cook  */
138c6993e4aSKees Cook void yama_task_free(struct task_struct *task)
1392d514487SKees Cook {
1402d514487SKees Cook 	yama_ptracer_del(task, task);
1412d514487SKees Cook }
1422d514487SKees Cook 
1432d514487SKees Cook /**
1442d514487SKees Cook  * yama_task_prctl - check for Yama-specific prctl operations
1452d514487SKees Cook  * @option: operation
1462d514487SKees Cook  * @arg2: argument
1472d514487SKees Cook  * @arg3: argument
1482d514487SKees Cook  * @arg4: argument
1492d514487SKees Cook  * @arg5: argument
1502d514487SKees Cook  *
1512d514487SKees Cook  * Return 0 on success, -ve on error.  -ENOSYS is returned when Yama
1522d514487SKees Cook  * does not handle the given option.
1532d514487SKees Cook  */
154c6993e4aSKees Cook int yama_task_prctl(int option, unsigned long arg2, unsigned long arg3,
1552d514487SKees Cook 			   unsigned long arg4, unsigned long arg5)
1562d514487SKees Cook {
1572d514487SKees Cook 	int rc;
1582d514487SKees Cook 	struct task_struct *myself = current;
1592d514487SKees Cook 
1602d514487SKees Cook 	rc = cap_task_prctl(option, arg2, arg3, arg4, arg5);
1612d514487SKees Cook 	if (rc != -ENOSYS)
1622d514487SKees Cook 		return rc;
1632d514487SKees Cook 
1642d514487SKees Cook 	switch (option) {
1652d514487SKees Cook 	case PR_SET_PTRACER:
1662d514487SKees Cook 		/* Since a thread can call prctl(), find the group leader
1672d514487SKees Cook 		 * before calling _add() or _del() on it, since we want
1682d514487SKees Cook 		 * process-level granularity of control. The tracer group
1692d514487SKees Cook 		 * leader checking is handled later when walking the ancestry
1702d514487SKees Cook 		 * at the time of PTRACE_ATTACH check.
1712d514487SKees Cook 		 */
1722d514487SKees Cook 		rcu_read_lock();
1732d514487SKees Cook 		if (!thread_group_leader(myself))
1742d514487SKees Cook 			myself = rcu_dereference(myself->group_leader);
1752d514487SKees Cook 		get_task_struct(myself);
1762d514487SKees Cook 		rcu_read_unlock();
1772d514487SKees Cook 
1782d514487SKees Cook 		if (arg2 == 0) {
1792d514487SKees Cook 			yama_ptracer_del(NULL, myself);
1802d514487SKees Cook 			rc = 0;
1812e4930ebSKees Cook 		} else if (arg2 == PR_SET_PTRACER_ANY || (int)arg2 == -1) {
182bf06189eSKees Cook 			rc = yama_ptracer_add(NULL, myself);
1832d514487SKees Cook 		} else {
1842d514487SKees Cook 			struct task_struct *tracer;
1852d514487SKees Cook 
1862d514487SKees Cook 			rcu_read_lock();
1872d514487SKees Cook 			tracer = find_task_by_vpid(arg2);
1882d514487SKees Cook 			if (tracer)
1892d514487SKees Cook 				get_task_struct(tracer);
1902d514487SKees Cook 			else
1912d514487SKees Cook 				rc = -EINVAL;
1922d514487SKees Cook 			rcu_read_unlock();
1932d514487SKees Cook 
1942d514487SKees Cook 			if (tracer) {
1952d514487SKees Cook 				rc = yama_ptracer_add(tracer, myself);
1962d514487SKees Cook 				put_task_struct(tracer);
1972d514487SKees Cook 			}
1982d514487SKees Cook 		}
1992d514487SKees Cook 
2002d514487SKees Cook 		put_task_struct(myself);
2012d514487SKees Cook 		break;
2022d514487SKees Cook 	}
2032d514487SKees Cook 
2042d514487SKees Cook 	return rc;
2052d514487SKees Cook }
2062d514487SKees Cook 
2072d514487SKees Cook /**
2082d514487SKees Cook  * task_is_descendant - walk up a process family tree looking for a match
2092d514487SKees Cook  * @parent: the process to compare against while walking up from child
2102d514487SKees Cook  * @child: the process to start from while looking upwards for parent
2112d514487SKees Cook  *
2122d514487SKees Cook  * Returns 1 if child is a descendant of parent, 0 if not.
2132d514487SKees Cook  */
2142d514487SKees Cook static int task_is_descendant(struct task_struct *parent,
2152d514487SKees Cook 			      struct task_struct *child)
2162d514487SKees Cook {
2172d514487SKees Cook 	int rc = 0;
2182d514487SKees Cook 	struct task_struct *walker = child;
2192d514487SKees Cook 
2202d514487SKees Cook 	if (!parent || !child)
2212d514487SKees Cook 		return 0;
2222d514487SKees Cook 
2232d514487SKees Cook 	rcu_read_lock();
2242d514487SKees Cook 	if (!thread_group_leader(parent))
2252d514487SKees Cook 		parent = rcu_dereference(parent->group_leader);
2262d514487SKees Cook 	while (walker->pid > 0) {
2272d514487SKees Cook 		if (!thread_group_leader(walker))
2282d514487SKees Cook 			walker = rcu_dereference(walker->group_leader);
2292d514487SKees Cook 		if (walker == parent) {
2302d514487SKees Cook 			rc = 1;
2312d514487SKees Cook 			break;
2322d514487SKees Cook 		}
2332d514487SKees Cook 		walker = rcu_dereference(walker->real_parent);
2342d514487SKees Cook 	}
2352d514487SKees Cook 	rcu_read_unlock();
2362d514487SKees Cook 
2372d514487SKees Cook 	return rc;
2382d514487SKees Cook }
2392d514487SKees Cook 
2402d514487SKees Cook /**
2412d514487SKees Cook  * ptracer_exception_found - tracer registered as exception for this tracee
2422d514487SKees Cook  * @tracer: the task_struct of the process attempting ptrace
2432d514487SKees Cook  * @tracee: the task_struct of the process to be ptraced
2442d514487SKees Cook  *
2452d514487SKees Cook  * Returns 1 if tracer has is ptracer exception ancestor for tracee.
2462d514487SKees Cook  */
2472d514487SKees Cook static int ptracer_exception_found(struct task_struct *tracer,
2482d514487SKees Cook 				   struct task_struct *tracee)
2492d514487SKees Cook {
2502d514487SKees Cook 	int rc = 0;
2512d514487SKees Cook 	struct ptrace_relation *relation;
2522d514487SKees Cook 	struct task_struct *parent = NULL;
253bf06189eSKees Cook 	bool found = false;
2542d514487SKees Cook 
2552d514487SKees Cook 	rcu_read_lock();
2562d514487SKees Cook 	if (!thread_group_leader(tracee))
2572d514487SKees Cook 		tracee = rcu_dereference(tracee->group_leader);
258235e7527SKees Cook 	list_for_each_entry_rcu(relation, &ptracer_relations, node) {
259235e7527SKees Cook 		if (relation->invalid)
260235e7527SKees Cook 			continue;
2612d514487SKees Cook 		if (relation->tracee == tracee) {
2622d514487SKees Cook 			parent = relation->tracer;
263bf06189eSKees Cook 			found = true;
2642d514487SKees Cook 			break;
2652d514487SKees Cook 		}
266235e7527SKees Cook 	}
2672d514487SKees Cook 
268bf06189eSKees Cook 	if (found && (parent == NULL || task_is_descendant(parent, tracer)))
2692d514487SKees Cook 		rc = 1;
2702d514487SKees Cook 	rcu_read_unlock();
2712d514487SKees Cook 
2722d514487SKees Cook 	return rc;
2732d514487SKees Cook }
2742d514487SKees Cook 
2752d514487SKees Cook /**
2762d514487SKees Cook  * yama_ptrace_access_check - validate PTRACE_ATTACH calls
2772d514487SKees Cook  * @child: task that current task is attempting to ptrace
2782d514487SKees Cook  * @mode: ptrace attach mode
2792d514487SKees Cook  *
2802d514487SKees Cook  * Returns 0 if following the ptrace is allowed, -ve on error.
2812d514487SKees Cook  */
282c6993e4aSKees Cook int yama_ptrace_access_check(struct task_struct *child,
2832d514487SKees Cook 				    unsigned int mode)
2842d514487SKees Cook {
2852d514487SKees Cook 	int rc;
2862d514487SKees Cook 
2872d514487SKees Cook 	/* If standard caps disallows it, so does Yama.  We should
2882d514487SKees Cook 	 * only tighten restrictions further.
2892d514487SKees Cook 	 */
2902d514487SKees Cook 	rc = cap_ptrace_access_check(child, mode);
2912d514487SKees Cook 	if (rc)
2922d514487SKees Cook 		return rc;
2932d514487SKees Cook 
2942d514487SKees Cook 	/* require ptrace target be a child of ptracer on attach */
295389da25fSKees Cook 	if (mode == PTRACE_MODE_ATTACH) {
296389da25fSKees Cook 		switch (ptrace_scope) {
297389da25fSKees Cook 		case YAMA_SCOPE_DISABLED:
298389da25fSKees Cook 			/* No additional restrictions. */
299389da25fSKees Cook 			break;
300389da25fSKees Cook 		case YAMA_SCOPE_RELATIONAL:
301389da25fSKees Cook 			if (!task_is_descendant(current, child) &&
3022d514487SKees Cook 			    !ptracer_exception_found(current, child) &&
3032cc8a716SKees Cook 			    !ns_capable(task_user_ns(child), CAP_SYS_PTRACE))
3042d514487SKees Cook 				rc = -EPERM;
305389da25fSKees Cook 			break;
306389da25fSKees Cook 		case YAMA_SCOPE_CAPABILITY:
3072cc8a716SKees Cook 			if (!ns_capable(task_user_ns(child), CAP_SYS_PTRACE))
308389da25fSKees Cook 				rc = -EPERM;
309389da25fSKees Cook 			break;
310389da25fSKees Cook 		case YAMA_SCOPE_NO_ATTACH:
311389da25fSKees Cook 		default:
312389da25fSKees Cook 			rc = -EPERM;
313389da25fSKees Cook 			break;
314389da25fSKees Cook 		}
315389da25fSKees Cook 	}
3162d514487SKees Cook 
3172d514487SKees Cook 	if (rc) {
318389da25fSKees Cook 		printk_ratelimited(KERN_NOTICE
319389da25fSKees Cook 			"ptrace of pid %d was attempted by: %s (pid %d)\n",
3207612bfeeSKees Cook 			child->pid, current->comm, current->pid);
3212d514487SKees Cook 	}
3222d514487SKees Cook 
3232d514487SKees Cook 	return rc;
3242d514487SKees Cook }
3252d514487SKees Cook 
3269d8dad74SKees Cook /**
3279d8dad74SKees Cook  * yama_ptrace_traceme - validate PTRACE_TRACEME calls
3289d8dad74SKees Cook  * @parent: task that will become the ptracer of the current task
3299d8dad74SKees Cook  *
3309d8dad74SKees Cook  * Returns 0 if following the ptrace is allowed, -ve on error.
3319d8dad74SKees Cook  */
332c6993e4aSKees Cook int yama_ptrace_traceme(struct task_struct *parent)
3339d8dad74SKees Cook {
3349d8dad74SKees Cook 	int rc;
3359d8dad74SKees Cook 
3369d8dad74SKees Cook 	/* If standard caps disallows it, so does Yama.  We should
3379d8dad74SKees Cook 	 * only tighten restrictions further.
3389d8dad74SKees Cook 	 */
3399d8dad74SKees Cook 	rc = cap_ptrace_traceme(parent);
3409d8dad74SKees Cook 	if (rc)
3419d8dad74SKees Cook 		return rc;
3429d8dad74SKees Cook 
3439d8dad74SKees Cook 	/* Only disallow PTRACE_TRACEME on more aggressive settings. */
3449d8dad74SKees Cook 	switch (ptrace_scope) {
3459d8dad74SKees Cook 	case YAMA_SCOPE_CAPABILITY:
3469d8dad74SKees Cook 		if (!ns_capable(task_user_ns(parent), CAP_SYS_PTRACE))
3479d8dad74SKees Cook 			rc = -EPERM;
3489d8dad74SKees Cook 		break;
3499d8dad74SKees Cook 	case YAMA_SCOPE_NO_ATTACH:
3509d8dad74SKees Cook 		rc = -EPERM;
3519d8dad74SKees Cook 		break;
3529d8dad74SKees Cook 	}
3539d8dad74SKees Cook 
3549d8dad74SKees Cook 	if (rc) {
3559d8dad74SKees Cook 		printk_ratelimited(KERN_NOTICE
3569d8dad74SKees Cook 			"ptraceme of pid %d was attempted by: %s (pid %d)\n",
3577612bfeeSKees Cook 			current->pid, parent->comm, parent->pid);
3589d8dad74SKees Cook 	}
3599d8dad74SKees Cook 
3609d8dad74SKees Cook 	return rc;
3619d8dad74SKees Cook }
3629d8dad74SKees Cook 
363c6993e4aSKees Cook #ifndef CONFIG_SECURITY_YAMA_STACKED
3642d514487SKees Cook static struct security_operations yama_ops = {
3652d514487SKees Cook 	.name =			"yama",
3662d514487SKees Cook 
3672d514487SKees Cook 	.ptrace_access_check =	yama_ptrace_access_check,
3689d8dad74SKees Cook 	.ptrace_traceme =	yama_ptrace_traceme,
3692d514487SKees Cook 	.task_prctl =		yama_task_prctl,
3702d514487SKees Cook 	.task_free =		yama_task_free,
3712d514487SKees Cook };
372c6993e4aSKees Cook #endif
3732d514487SKees Cook 
3742d514487SKees Cook #ifdef CONFIG_SYSCTL
375389da25fSKees Cook static int yama_dointvec_minmax(struct ctl_table *table, int write,
376389da25fSKees Cook 				void __user *buffer, size_t *lenp, loff_t *ppos)
377389da25fSKees Cook {
378389da25fSKees Cook 	int rc;
379389da25fSKees Cook 
380389da25fSKees Cook 	if (write && !capable(CAP_SYS_PTRACE))
381389da25fSKees Cook 		return -EPERM;
382389da25fSKees Cook 
383389da25fSKees Cook 	rc = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
384389da25fSKees Cook 	if (rc)
385389da25fSKees Cook 		return rc;
386389da25fSKees Cook 
387389da25fSKees Cook 	/* Lock the max value if it ever gets set. */
388389da25fSKees Cook 	if (write && *(int *)table->data == *(int *)table->extra2)
389389da25fSKees Cook 		table->extra1 = table->extra2;
390389da25fSKees Cook 
391389da25fSKees Cook 	return rc;
392389da25fSKees Cook }
393389da25fSKees Cook 
3942d514487SKees Cook static int zero;
395389da25fSKees Cook static int max_scope = YAMA_SCOPE_NO_ATTACH;
3962d514487SKees Cook 
3972d514487SKees Cook struct ctl_path yama_sysctl_path[] = {
3982d514487SKees Cook 	{ .procname = "kernel", },
3992d514487SKees Cook 	{ .procname = "yama", },
4002d514487SKees Cook 	{ }
4012d514487SKees Cook };
4022d514487SKees Cook 
4032d514487SKees Cook static struct ctl_table yama_sysctl_table[] = {
4042d514487SKees Cook 	{
4052d514487SKees Cook 		.procname       = "ptrace_scope",
4062d514487SKees Cook 		.data           = &ptrace_scope,
4072d514487SKees Cook 		.maxlen         = sizeof(int),
4082d514487SKees Cook 		.mode           = 0644,
409389da25fSKees Cook 		.proc_handler   = yama_dointvec_minmax,
4102d514487SKees Cook 		.extra1         = &zero,
411389da25fSKees Cook 		.extra2         = &max_scope,
4122d514487SKees Cook 	},
4132d514487SKees Cook 	{ }
4142d514487SKees Cook };
4152d514487SKees Cook #endif /* CONFIG_SYSCTL */
4162d514487SKees Cook 
4172d514487SKees Cook static __init int yama_init(void)
4182d514487SKees Cook {
419c6993e4aSKees Cook #ifndef CONFIG_SECURITY_YAMA_STACKED
4202d514487SKees Cook 	if (!security_module_enable(&yama_ops))
4212d514487SKees Cook 		return 0;
422c6993e4aSKees Cook #endif
4232d514487SKees Cook 
4242d514487SKees Cook 	printk(KERN_INFO "Yama: becoming mindful.\n");
4252d514487SKees Cook 
426c6993e4aSKees Cook #ifndef CONFIG_SECURITY_YAMA_STACKED
4272d514487SKees Cook 	if (register_security(&yama_ops))
4282d514487SKees Cook 		panic("Yama: kernel registration failed.\n");
429c6993e4aSKees Cook #endif
4302d514487SKees Cook 
4312d514487SKees Cook #ifdef CONFIG_SYSCTL
4322d514487SKees Cook 	if (!register_sysctl_paths(yama_sysctl_path, yama_sysctl_table))
4332d514487SKees Cook 		panic("Yama: sysctl registration failed.\n");
4342d514487SKees Cook #endif
4352d514487SKees Cook 
4362d514487SKees Cook 	return 0;
4372d514487SKees Cook }
4382d514487SKees Cook 
4392d514487SKees Cook security_initcall(yama_init);
440