Skip to content

Commit 9f99798

Browse files
Tetsuo HandaJames Morris
authored andcommitted
ptrace: mark __ptrace_may_access() static
__ptrace_may_access() is used within only kernel/ptrace.c. Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Signed-off-by: James Morris <james.l.morris@oracle.com>
1 parent de4bb3b commit 9f99798

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

include/linux/ptrace.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ extern void exit_ptrace(struct task_struct *tracer);
130130
#define PTRACE_MODE_READ 0x01
131131
#define PTRACE_MODE_ATTACH 0x02
132132
#define PTRACE_MODE_NOAUDIT 0x04
133-
/* Returns 0 on success, -errno on denial. */
134-
extern int __ptrace_may_access(struct task_struct *task, unsigned int mode);
135133
/* Returns true on success, false on denial. */
136134
extern bool ptrace_may_access(struct task_struct *task, unsigned int mode);
137135

kernel/ptrace.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ static int ptrace_has_cap(struct user_namespace *ns, unsigned int mode)
180180
return has_ns_capability(current, ns, CAP_SYS_PTRACE);
181181
}
182182

183-
int __ptrace_may_access(struct task_struct *task, unsigned int mode)
183+
/* Returns 0 on success, -errno on denial. */
184+
static int __ptrace_may_access(struct task_struct *task, unsigned int mode)
184185
{
185186
const struct cred *cred = current_cred(), *tcred;
186187

0 commit comments

Comments
 (0)