Skip to content

Commit

Permalink
Yama: mark local symbols as static
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Mukesh Ojha <[email protected]>
Signed-off-by: Jann Horn <[email protected]>
[kees: merged similar static-ness fixes into a single patch]
Link: https://lkml.kernel.org/r/[email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Kees Cook <[email protected]>
Signed-off-by: James Morris <[email protected]>
  • Loading branch information
thejh authored and James Morris committed Mar 28, 2019
1 parent 8c7ae38 commit 1aa176e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions security/yama/yama_lsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ static void yama_ptracer_del(struct task_struct *tracer,
* yama_task_free - check for task_pid to remove from exception list
* @task: task being removed
*/
void yama_task_free(struct task_struct *task)
static void yama_task_free(struct task_struct *task)
{
yama_ptracer_del(task, task);
}
Expand All @@ -222,7 +222,7 @@ void yama_task_free(struct task_struct *task)
* Return 0 on success, -ve on error. -ENOSYS is returned when Yama
* does not handle the given option.
*/
int yama_task_prctl(int option, unsigned long arg2, unsigned long arg3,
static int yama_task_prctl(int option, unsigned long arg2, unsigned long arg3,
unsigned long arg4, unsigned long arg5)
{
int rc = -ENOSYS;
Expand Down Expand Up @@ -401,7 +401,7 @@ static int yama_ptrace_access_check(struct task_struct *child,
*
* Returns 0 if following the ptrace is allowed, -ve on error.
*/
int yama_ptrace_traceme(struct task_struct *parent)
static int yama_ptrace_traceme(struct task_struct *parent)
{
int rc = 0;

Expand Down Expand Up @@ -452,7 +452,7 @@ static int yama_dointvec_minmax(struct ctl_table *table, int write,
static int zero;
static int max_scope = YAMA_SCOPE_NO_ATTACH;

struct ctl_path yama_sysctl_path[] = {
static struct ctl_path yama_sysctl_path[] = {
{ .procname = "kernel", },
{ .procname = "yama", },
{ }
Expand Down

0 comments on commit 1aa176e

Please sign in to comment.