Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jann Horn and committed by
James Morris
1aa176ef 8c7ae38d

+4 -4
+4 -4
security/yama/yama_lsm.c
··· 206 206 * yama_task_free - check for task_pid to remove from exception list 207 207 * @task: task being removed 208 208 */ 209 - void yama_task_free(struct task_struct *task) 209 + static void yama_task_free(struct task_struct *task) 210 210 { 211 211 yama_ptracer_del(task, task); 212 212 } ··· 222 222 * Return 0 on success, -ve on error. -ENOSYS is returned when Yama 223 223 * does not handle the given option. 224 224 */ 225 - int yama_task_prctl(int option, unsigned long arg2, unsigned long arg3, 225 + static int yama_task_prctl(int option, unsigned long arg2, unsigned long arg3, 226 226 unsigned long arg4, unsigned long arg5) 227 227 { 228 228 int rc = -ENOSYS; ··· 401 401 * 402 402 * Returns 0 if following the ptrace is allowed, -ve on error. 403 403 */ 404 - int yama_ptrace_traceme(struct task_struct *parent) 404 + static int yama_ptrace_traceme(struct task_struct *parent) 405 405 { 406 406 int rc = 0; 407 407 ··· 452 452 static int zero; 453 453 static int max_scope = YAMA_SCOPE_NO_ATTACH; 454 454 455 - struct ctl_path yama_sysctl_path[] = { 455 + static struct ctl_path yama_sysctl_path[] = { 456 456 { .procname = "kernel", }, 457 457 { .procname = "yama", }, 458 458 { }