summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorJann Horn <jannh@google.com>2019-03-27 20:21:42 -0400
committerJames Morris <james.morris@microsoft.com>2019-03-28 13:02:29 -0400
commit1aa176ef5a451adc0546d5aaa3fb107975c786b7 (patch)
treebd146382cca05e6425d796141ed6b7c814486a2a /security
parent8c7ae38d1ce12a0eaeba655df8562552b3596c7f (diff)
Yama: mark local symbols as static
sparse complains that Yama defines functions and a variable as non-static even though they don't exist in any header. Fix it by making them static. Co-developed-by: Mukesh Ojha <mojha@codeaurora.org> Signed-off-by: Mukesh Ojha <mojha@codeaurora.org> Signed-off-by: Jann Horn <jannh@google.com> [kees: merged similar static-ness fixes into a single patch] Link: https://lkml.kernel.org/r/20190326230841.87834-1-jannh@google.com Link: https://lkml.kernel.org/r/1553673018-19234-1-git-send-email-mojha@codeaurora.org Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: James Morris <james.morris@microsoft.com>
Diffstat (limited to 'security')
-rw-r--r--security/yama/yama_lsm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/security/yama/yama_lsm.c b/security/yama/yama_lsm.c
index 57cc60722dd3..efac68556b45 100644
--- a/security/yama/yama_lsm.c
+++ b/security/yama/yama_lsm.c
@@ -206,7 +206,7 @@ static void yama_ptracer_del(struct task_struct *tracer,
206 * yama_task_free - check for task_pid to remove from exception list 206 * yama_task_free - check for task_pid to remove from exception list
207 * @task: task being removed 207 * @task: task being removed
208 */ 208 */
209void yama_task_free(struct task_struct *task) 209static void yama_task_free(struct task_struct *task)
210{ 210{
211 yama_ptracer_del(task, task); 211 yama_ptracer_del(task, task);
212} 212}
@@ -222,7 +222,7 @@ void yama_task_free(struct task_struct *task)
222 * Return 0 on success, -ve on error. -ENOSYS is returned when Yama 222 * Return 0 on success, -ve on error. -ENOSYS is returned when Yama
223 * does not handle the given option. 223 * does not handle the given option.
224 */ 224 */
225int yama_task_prctl(int option, unsigned long arg2, unsigned long arg3, 225static int yama_task_prctl(int option, unsigned long arg2, unsigned long arg3,
226 unsigned long arg4, unsigned long arg5) 226 unsigned long arg4, unsigned long arg5)
227{ 227{
228 int rc = -ENOSYS; 228 int rc = -ENOSYS;
@@ -401,7 +401,7 @@ static int yama_ptrace_access_check(struct task_struct *child,
401 * 401 *
402 * Returns 0 if following the ptrace is allowed, -ve on error. 402 * Returns 0 if following the ptrace is allowed, -ve on error.
403 */ 403 */
404int yama_ptrace_traceme(struct task_struct *parent) 404static int yama_ptrace_traceme(struct task_struct *parent)
405{ 405{
406 int rc = 0; 406 int rc = 0;
407 407
@@ -452,7 +452,7 @@ static int yama_dointvec_minmax(struct ctl_table *table, int write,
452static int zero; 452static int zero;
453static int max_scope = YAMA_SCOPE_NO_ATTACH; 453static int max_scope = YAMA_SCOPE_NO_ATTACH;
454 454
455struct ctl_path yama_sysctl_path[] = { 455static struct ctl_path yama_sysctl_path[] = {
456 { .procname = "kernel", }, 456 { .procname = "kernel", },
457 { .procname = "yama", }, 457 { .procname = "yama", },
458 { } 458 { }