Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Yama Linux Security Module |
| 3 | * |
| 4 | * Author: Kees Cook <keescook@chromium.org> |
| 5 | * |
| 6 | * Copyright (C) 2010 Canonical, Ltd. |
| 7 | * Copyright (C) 2011 The Chromium OS Authors. |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License version 2, as |
| 11 | * published by the Free Software Foundation. |
| 12 | * |
| 13 | */ |
| 14 | |
| 15 | #include <linux/security.h> |
| 16 | #include <linux/sysctl.h> |
| 17 | #include <linux/ptrace.h> |
| 18 | #include <linux/prctl.h> |
| 19 | #include <linux/ratelimit.h> |
| 20 | |
Kees Cook | 389da25 | 2012-04-16 11:56:45 -0700 | [diff] [blame] | 21 | #define YAMA_SCOPE_DISABLED 0 |
| 22 | #define YAMA_SCOPE_RELATIONAL 1 |
| 23 | #define YAMA_SCOPE_CAPABILITY 2 |
| 24 | #define YAMA_SCOPE_NO_ATTACH 3 |
| 25 | |
| 26 | static int ptrace_scope = YAMA_SCOPE_RELATIONAL; |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 27 | |
| 28 | /* describe a ptrace relationship for potential exception */ |
| 29 | struct ptrace_relation { |
| 30 | struct task_struct *tracer; |
| 31 | struct task_struct *tracee; |
| 32 | struct list_head node; |
Kees Cook | 93b69d4 | 2012-10-18 14:53:58 -0700 | [diff] [blame^] | 33 | struct rcu_head rcu; |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 34 | }; |
| 35 | |
| 36 | static LIST_HEAD(ptracer_relations); |
| 37 | static DEFINE_SPINLOCK(ptracer_relations_lock); |
| 38 | |
| 39 | /** |
| 40 | * yama_ptracer_add - add/replace an exception for this tracer/tracee pair |
| 41 | * @tracer: the task_struct of the process doing the ptrace |
| 42 | * @tracee: the task_struct of the process to be ptraced |
| 43 | * |
| 44 | * Each tracee can have, at most, one tracer registered. Each time this |
| 45 | * is called, the prior registered tracer will be replaced for the tracee. |
| 46 | * |
| 47 | * Returns 0 if relationship was added, -ve on error. |
| 48 | */ |
| 49 | static int yama_ptracer_add(struct task_struct *tracer, |
| 50 | struct task_struct *tracee) |
| 51 | { |
Kees Cook | 93b69d4 | 2012-10-18 14:53:58 -0700 | [diff] [blame^] | 52 | struct ptrace_relation *relation, *added; |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 53 | |
| 54 | added = kmalloc(sizeof(*added), GFP_KERNEL); |
| 55 | if (!added) |
| 56 | return -ENOMEM; |
| 57 | |
Kees Cook | 93b69d4 | 2012-10-18 14:53:58 -0700 | [diff] [blame^] | 58 | added->tracee = tracee; |
| 59 | added->tracer = tracer; |
| 60 | |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 61 | spin_lock_bh(&ptracer_relations_lock); |
Kees Cook | 93b69d4 | 2012-10-18 14:53:58 -0700 | [diff] [blame^] | 62 | rcu_read_lock(); |
| 63 | list_for_each_entry_rcu(relation, &ptracer_relations, node) { |
| 64 | if (relation->tracee == tracee) { |
| 65 | list_replace_rcu(&relation->node, &added->node); |
| 66 | kfree_rcu(relation, rcu); |
| 67 | goto out; |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 68 | } |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 69 | } |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 70 | |
Kees Cook | 93b69d4 | 2012-10-18 14:53:58 -0700 | [diff] [blame^] | 71 | list_add_rcu(&added->node, &ptracer_relations); |
| 72 | |
| 73 | out: |
| 74 | rcu_read_unlock(); |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 75 | spin_unlock_bh(&ptracer_relations_lock); |
Kees Cook | 93b69d4 | 2012-10-18 14:53:58 -0700 | [diff] [blame^] | 76 | return 0; |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 77 | } |
| 78 | |
| 79 | /** |
| 80 | * yama_ptracer_del - remove exceptions related to the given tasks |
| 81 | * @tracer: remove any relation where tracer task matches |
| 82 | * @tracee: remove any relation where tracee task matches |
| 83 | */ |
| 84 | static void yama_ptracer_del(struct task_struct *tracer, |
| 85 | struct task_struct *tracee) |
| 86 | { |
Kees Cook | 93b69d4 | 2012-10-18 14:53:58 -0700 | [diff] [blame^] | 87 | struct ptrace_relation *relation; |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 88 | |
| 89 | spin_lock_bh(&ptracer_relations_lock); |
Kees Cook | 93b69d4 | 2012-10-18 14:53:58 -0700 | [diff] [blame^] | 90 | rcu_read_lock(); |
| 91 | list_for_each_entry_rcu(relation, &ptracer_relations, node) { |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 92 | if (relation->tracee == tracee || |
Kees Cook | bf06189 | 2012-02-14 16:48:09 -0800 | [diff] [blame] | 93 | (tracer && relation->tracer == tracer)) { |
Kees Cook | 93b69d4 | 2012-10-18 14:53:58 -0700 | [diff] [blame^] | 94 | list_del_rcu(&relation->node); |
| 95 | kfree_rcu(relation, rcu); |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 96 | } |
Kees Cook | 93b69d4 | 2012-10-18 14:53:58 -0700 | [diff] [blame^] | 97 | } |
| 98 | rcu_read_unlock(); |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 99 | spin_unlock_bh(&ptracer_relations_lock); |
| 100 | } |
| 101 | |
| 102 | /** |
| 103 | * yama_task_free - check for task_pid to remove from exception list |
| 104 | * @task: task being removed |
| 105 | */ |
Kees Cook | c6993e4 | 2012-09-04 13:32:13 -0700 | [diff] [blame] | 106 | void yama_task_free(struct task_struct *task) |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 107 | { |
| 108 | yama_ptracer_del(task, task); |
| 109 | } |
| 110 | |
| 111 | /** |
| 112 | * yama_task_prctl - check for Yama-specific prctl operations |
| 113 | * @option: operation |
| 114 | * @arg2: argument |
| 115 | * @arg3: argument |
| 116 | * @arg4: argument |
| 117 | * @arg5: argument |
| 118 | * |
| 119 | * Return 0 on success, -ve on error. -ENOSYS is returned when Yama |
| 120 | * does not handle the given option. |
| 121 | */ |
Kees Cook | c6993e4 | 2012-09-04 13:32:13 -0700 | [diff] [blame] | 122 | int yama_task_prctl(int option, unsigned long arg2, unsigned long arg3, |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 123 | unsigned long arg4, unsigned long arg5) |
| 124 | { |
| 125 | int rc; |
| 126 | struct task_struct *myself = current; |
| 127 | |
| 128 | rc = cap_task_prctl(option, arg2, arg3, arg4, arg5); |
| 129 | if (rc != -ENOSYS) |
| 130 | return rc; |
| 131 | |
| 132 | switch (option) { |
| 133 | case PR_SET_PTRACER: |
| 134 | /* Since a thread can call prctl(), find the group leader |
| 135 | * before calling _add() or _del() on it, since we want |
| 136 | * process-level granularity of control. The tracer group |
| 137 | * leader checking is handled later when walking the ancestry |
| 138 | * at the time of PTRACE_ATTACH check. |
| 139 | */ |
| 140 | rcu_read_lock(); |
| 141 | if (!thread_group_leader(myself)) |
| 142 | myself = rcu_dereference(myself->group_leader); |
| 143 | get_task_struct(myself); |
| 144 | rcu_read_unlock(); |
| 145 | |
| 146 | if (arg2 == 0) { |
| 147 | yama_ptracer_del(NULL, myself); |
| 148 | rc = 0; |
Kees Cook | 2e4930e | 2012-08-27 11:38:13 -0700 | [diff] [blame] | 149 | } else if (arg2 == PR_SET_PTRACER_ANY || (int)arg2 == -1) { |
Kees Cook | bf06189 | 2012-02-14 16:48:09 -0800 | [diff] [blame] | 150 | rc = yama_ptracer_add(NULL, myself); |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 151 | } else { |
| 152 | struct task_struct *tracer; |
| 153 | |
| 154 | rcu_read_lock(); |
| 155 | tracer = find_task_by_vpid(arg2); |
| 156 | if (tracer) |
| 157 | get_task_struct(tracer); |
| 158 | else |
| 159 | rc = -EINVAL; |
| 160 | rcu_read_unlock(); |
| 161 | |
| 162 | if (tracer) { |
| 163 | rc = yama_ptracer_add(tracer, myself); |
| 164 | put_task_struct(tracer); |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | put_task_struct(myself); |
| 169 | break; |
| 170 | } |
| 171 | |
| 172 | return rc; |
| 173 | } |
| 174 | |
| 175 | /** |
| 176 | * task_is_descendant - walk up a process family tree looking for a match |
| 177 | * @parent: the process to compare against while walking up from child |
| 178 | * @child: the process to start from while looking upwards for parent |
| 179 | * |
| 180 | * Returns 1 if child is a descendant of parent, 0 if not. |
| 181 | */ |
| 182 | static int task_is_descendant(struct task_struct *parent, |
| 183 | struct task_struct *child) |
| 184 | { |
| 185 | int rc = 0; |
| 186 | struct task_struct *walker = child; |
| 187 | |
| 188 | if (!parent || !child) |
| 189 | return 0; |
| 190 | |
| 191 | rcu_read_lock(); |
| 192 | if (!thread_group_leader(parent)) |
| 193 | parent = rcu_dereference(parent->group_leader); |
| 194 | while (walker->pid > 0) { |
| 195 | if (!thread_group_leader(walker)) |
| 196 | walker = rcu_dereference(walker->group_leader); |
| 197 | if (walker == parent) { |
| 198 | rc = 1; |
| 199 | break; |
| 200 | } |
| 201 | walker = rcu_dereference(walker->real_parent); |
| 202 | } |
| 203 | rcu_read_unlock(); |
| 204 | |
| 205 | return rc; |
| 206 | } |
| 207 | |
| 208 | /** |
| 209 | * ptracer_exception_found - tracer registered as exception for this tracee |
| 210 | * @tracer: the task_struct of the process attempting ptrace |
| 211 | * @tracee: the task_struct of the process to be ptraced |
| 212 | * |
| 213 | * Returns 1 if tracer has is ptracer exception ancestor for tracee. |
| 214 | */ |
| 215 | static int ptracer_exception_found(struct task_struct *tracer, |
| 216 | struct task_struct *tracee) |
| 217 | { |
| 218 | int rc = 0; |
| 219 | struct ptrace_relation *relation; |
| 220 | struct task_struct *parent = NULL; |
Kees Cook | bf06189 | 2012-02-14 16:48:09 -0800 | [diff] [blame] | 221 | bool found = false; |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 222 | |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 223 | rcu_read_lock(); |
| 224 | if (!thread_group_leader(tracee)) |
| 225 | tracee = rcu_dereference(tracee->group_leader); |
Kees Cook | 93b69d4 | 2012-10-18 14:53:58 -0700 | [diff] [blame^] | 226 | list_for_each_entry_rcu(relation, &ptracer_relations, node) |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 227 | if (relation->tracee == tracee) { |
| 228 | parent = relation->tracer; |
Kees Cook | bf06189 | 2012-02-14 16:48:09 -0800 | [diff] [blame] | 229 | found = true; |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 230 | break; |
| 231 | } |
| 232 | |
Kees Cook | bf06189 | 2012-02-14 16:48:09 -0800 | [diff] [blame] | 233 | if (found && (parent == NULL || task_is_descendant(parent, tracer))) |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 234 | rc = 1; |
| 235 | rcu_read_unlock(); |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 236 | |
| 237 | return rc; |
| 238 | } |
| 239 | |
| 240 | /** |
| 241 | * yama_ptrace_access_check - validate PTRACE_ATTACH calls |
| 242 | * @child: task that current task is attempting to ptrace |
| 243 | * @mode: ptrace attach mode |
| 244 | * |
| 245 | * Returns 0 if following the ptrace is allowed, -ve on error. |
| 246 | */ |
Kees Cook | c6993e4 | 2012-09-04 13:32:13 -0700 | [diff] [blame] | 247 | int yama_ptrace_access_check(struct task_struct *child, |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 248 | unsigned int mode) |
| 249 | { |
| 250 | int rc; |
| 251 | |
| 252 | /* If standard caps disallows it, so does Yama. We should |
| 253 | * only tighten restrictions further. |
| 254 | */ |
| 255 | rc = cap_ptrace_access_check(child, mode); |
| 256 | if (rc) |
| 257 | return rc; |
| 258 | |
| 259 | /* require ptrace target be a child of ptracer on attach */ |
Kees Cook | 389da25 | 2012-04-16 11:56:45 -0700 | [diff] [blame] | 260 | if (mode == PTRACE_MODE_ATTACH) { |
| 261 | switch (ptrace_scope) { |
| 262 | case YAMA_SCOPE_DISABLED: |
| 263 | /* No additional restrictions. */ |
| 264 | break; |
| 265 | case YAMA_SCOPE_RELATIONAL: |
| 266 | if (!task_is_descendant(current, child) && |
| 267 | !ptracer_exception_found(current, child) && |
Kees Cook | 2cc8a71 | 2012-05-14 10:19:28 -0700 | [diff] [blame] | 268 | !ns_capable(task_user_ns(child), CAP_SYS_PTRACE)) |
Kees Cook | 389da25 | 2012-04-16 11:56:45 -0700 | [diff] [blame] | 269 | rc = -EPERM; |
| 270 | break; |
| 271 | case YAMA_SCOPE_CAPABILITY: |
Kees Cook | 2cc8a71 | 2012-05-14 10:19:28 -0700 | [diff] [blame] | 272 | if (!ns_capable(task_user_ns(child), CAP_SYS_PTRACE)) |
Kees Cook | 389da25 | 2012-04-16 11:56:45 -0700 | [diff] [blame] | 273 | rc = -EPERM; |
| 274 | break; |
| 275 | case YAMA_SCOPE_NO_ATTACH: |
| 276 | default: |
| 277 | rc = -EPERM; |
| 278 | break; |
| 279 | } |
| 280 | } |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 281 | |
| 282 | if (rc) { |
Kees Cook | 389da25 | 2012-04-16 11:56:45 -0700 | [diff] [blame] | 283 | printk_ratelimited(KERN_NOTICE |
| 284 | "ptrace of pid %d was attempted by: %s (pid %d)\n", |
Kees Cook | 7612bfe | 2012-08-15 11:41:55 -0700 | [diff] [blame] | 285 | child->pid, current->comm, current->pid); |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 286 | } |
| 287 | |
| 288 | return rc; |
| 289 | } |
| 290 | |
Kees Cook | 9d8dad7 | 2012-08-09 19:01:26 -0700 | [diff] [blame] | 291 | /** |
| 292 | * yama_ptrace_traceme - validate PTRACE_TRACEME calls |
| 293 | * @parent: task that will become the ptracer of the current task |
| 294 | * |
| 295 | * Returns 0 if following the ptrace is allowed, -ve on error. |
| 296 | */ |
Kees Cook | c6993e4 | 2012-09-04 13:32:13 -0700 | [diff] [blame] | 297 | int yama_ptrace_traceme(struct task_struct *parent) |
Kees Cook | 9d8dad7 | 2012-08-09 19:01:26 -0700 | [diff] [blame] | 298 | { |
| 299 | int rc; |
| 300 | |
| 301 | /* If standard caps disallows it, so does Yama. We should |
| 302 | * only tighten restrictions further. |
| 303 | */ |
| 304 | rc = cap_ptrace_traceme(parent); |
| 305 | if (rc) |
| 306 | return rc; |
| 307 | |
| 308 | /* Only disallow PTRACE_TRACEME on more aggressive settings. */ |
| 309 | switch (ptrace_scope) { |
| 310 | case YAMA_SCOPE_CAPABILITY: |
| 311 | if (!ns_capable(task_user_ns(parent), CAP_SYS_PTRACE)) |
| 312 | rc = -EPERM; |
| 313 | break; |
| 314 | case YAMA_SCOPE_NO_ATTACH: |
| 315 | rc = -EPERM; |
| 316 | break; |
| 317 | } |
| 318 | |
| 319 | if (rc) { |
Kees Cook | 9d8dad7 | 2012-08-09 19:01:26 -0700 | [diff] [blame] | 320 | printk_ratelimited(KERN_NOTICE |
| 321 | "ptraceme of pid %d was attempted by: %s (pid %d)\n", |
Kees Cook | 7612bfe | 2012-08-15 11:41:55 -0700 | [diff] [blame] | 322 | current->pid, parent->comm, parent->pid); |
Kees Cook | 9d8dad7 | 2012-08-09 19:01:26 -0700 | [diff] [blame] | 323 | } |
| 324 | |
| 325 | return rc; |
| 326 | } |
| 327 | |
Kees Cook | c6993e4 | 2012-09-04 13:32:13 -0700 | [diff] [blame] | 328 | #ifndef CONFIG_SECURITY_YAMA_STACKED |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 329 | static struct security_operations yama_ops = { |
| 330 | .name = "yama", |
| 331 | |
| 332 | .ptrace_access_check = yama_ptrace_access_check, |
Kees Cook | 9d8dad7 | 2012-08-09 19:01:26 -0700 | [diff] [blame] | 333 | .ptrace_traceme = yama_ptrace_traceme, |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 334 | .task_prctl = yama_task_prctl, |
| 335 | .task_free = yama_task_free, |
| 336 | }; |
Kees Cook | c6993e4 | 2012-09-04 13:32:13 -0700 | [diff] [blame] | 337 | #endif |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 338 | |
| 339 | #ifdef CONFIG_SYSCTL |
Kees Cook | 389da25 | 2012-04-16 11:56:45 -0700 | [diff] [blame] | 340 | static int yama_dointvec_minmax(struct ctl_table *table, int write, |
| 341 | void __user *buffer, size_t *lenp, loff_t *ppos) |
| 342 | { |
| 343 | int rc; |
| 344 | |
| 345 | if (write && !capable(CAP_SYS_PTRACE)) |
| 346 | return -EPERM; |
| 347 | |
| 348 | rc = proc_dointvec_minmax(table, write, buffer, lenp, ppos); |
| 349 | if (rc) |
| 350 | return rc; |
| 351 | |
| 352 | /* Lock the max value if it ever gets set. */ |
| 353 | if (write && *(int *)table->data == *(int *)table->extra2) |
| 354 | table->extra1 = table->extra2; |
| 355 | |
| 356 | return rc; |
| 357 | } |
| 358 | |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 359 | static int zero; |
Kees Cook | 389da25 | 2012-04-16 11:56:45 -0700 | [diff] [blame] | 360 | static int max_scope = YAMA_SCOPE_NO_ATTACH; |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 361 | |
| 362 | struct ctl_path yama_sysctl_path[] = { |
| 363 | { .procname = "kernel", }, |
| 364 | { .procname = "yama", }, |
| 365 | { } |
| 366 | }; |
| 367 | |
| 368 | static struct ctl_table yama_sysctl_table[] = { |
| 369 | { |
| 370 | .procname = "ptrace_scope", |
| 371 | .data = &ptrace_scope, |
| 372 | .maxlen = sizeof(int), |
| 373 | .mode = 0644, |
Kees Cook | 389da25 | 2012-04-16 11:56:45 -0700 | [diff] [blame] | 374 | .proc_handler = yama_dointvec_minmax, |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 375 | .extra1 = &zero, |
Kees Cook | 389da25 | 2012-04-16 11:56:45 -0700 | [diff] [blame] | 376 | .extra2 = &max_scope, |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 377 | }, |
| 378 | { } |
| 379 | }; |
| 380 | #endif /* CONFIG_SYSCTL */ |
| 381 | |
| 382 | static __init int yama_init(void) |
| 383 | { |
Kees Cook | c6993e4 | 2012-09-04 13:32:13 -0700 | [diff] [blame] | 384 | #ifndef CONFIG_SECURITY_YAMA_STACKED |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 385 | if (!security_module_enable(&yama_ops)) |
| 386 | return 0; |
Kees Cook | c6993e4 | 2012-09-04 13:32:13 -0700 | [diff] [blame] | 387 | #endif |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 388 | |
| 389 | printk(KERN_INFO "Yama: becoming mindful.\n"); |
| 390 | |
Kees Cook | c6993e4 | 2012-09-04 13:32:13 -0700 | [diff] [blame] | 391 | #ifndef CONFIG_SECURITY_YAMA_STACKED |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 392 | if (register_security(&yama_ops)) |
| 393 | panic("Yama: kernel registration failed.\n"); |
Kees Cook | c6993e4 | 2012-09-04 13:32:13 -0700 | [diff] [blame] | 394 | #endif |
Kees Cook | 2d51448 | 2011-12-21 12:17:04 -0800 | [diff] [blame] | 395 | |
| 396 | #ifdef CONFIG_SYSCTL |
| 397 | if (!register_sysctl_paths(yama_sysctl_path, yama_sysctl_table)) |
| 398 | panic("Yama: sysctl registration failed.\n"); |
| 399 | #endif |
| 400 | |
| 401 | return 0; |
| 402 | } |
| 403 | |
| 404 | security_initcall(yama_init); |