Skip to content

Commit 1aa176e

Browse files
thejhJames Morris
authored andcommitted
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>
1 parent 8c7ae38 commit 1aa176e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

security/yama/yama_lsm.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ static void yama_ptracer_del(struct task_struct *tracer,
206206
* yama_task_free - check for task_pid to remove from exception list
207207
* @task: task being removed
208208
*/
209-
void yama_task_free(struct task_struct *task)
209+
static void yama_task_free(struct task_struct *task)
210210
{
211211
yama_ptracer_del(task, task);
212212
}
@@ -222,7 +222,7 @@ void yama_task_free(struct task_struct *task)
222222
* Return 0 on success, -ve on error. -ENOSYS is returned when Yama
223223
* does not handle the given option.
224224
*/
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,
226226
unsigned long arg4, unsigned long arg5)
227227
{
228228
int rc = -ENOSYS;
@@ -401,7 +401,7 @@ static int yama_ptrace_access_check(struct task_struct *child,
401401
*
402402
* Returns 0 if following the ptrace is allowed, -ve on error.
403403
*/
404-
int yama_ptrace_traceme(struct task_struct *parent)
404+
static int yama_ptrace_traceme(struct task_struct *parent)
405405
{
406406
int rc = 0;
407407

@@ -452,7 +452,7 @@ static int yama_dointvec_minmax(struct ctl_table *table, int write,
452452
static int zero;
453453
static int max_scope = YAMA_SCOPE_NO_ATTACH;
454454

455-
struct ctl_path yama_sysctl_path[] = {
455+
static struct ctl_path yama_sysctl_path[] = {
456456
{ .procname = "kernel", },
457457
{ .procname = "yama", },
458458
{ }

0 commit comments

Comments
 (0)