Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 157301
b: refs/heads/master
c: 9e48858
h: refs/heads/master
i:
  157299: 7a54cb9
v: v3
  • Loading branch information
Ingo Molnar authored and James Morris committed Jun 24, 2009
1 parent 9dc8cf5 commit 31eb435
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 86abcf9cebf7b5ceb33facde297face5ec4d2260
refs/heads/master: 9e48858f7d36a6a3849f1d1b40c3bf5624b4ee7c
14 changes: 7 additions & 7 deletions trunk/include/linux/security.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct audit_krule;
extern int cap_capable(struct task_struct *tsk, const struct cred *cred,
int cap, int audit);
extern int cap_settime(struct timespec *ts, struct timezone *tz);
extern int cap_ptrace_may_access(struct task_struct *child, unsigned int mode);
extern int cap_ptrace_access_check(struct task_struct *child, unsigned int mode);
extern int cap_ptrace_traceme(struct task_struct *parent);
extern int cap_capget(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted);
extern int cap_capset(struct cred *new, const struct cred *old,
Expand Down Expand Up @@ -1209,7 +1209,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
* @alter contains the flag indicating whether changes are to be made.
* Return 0 if permission is granted.
*
* @ptrace_may_access:
* @ptrace_access_check:
* Check permission before allowing the current process to trace the
* @child process.
* Security modules may also want to perform a process tracing check
Expand All @@ -1224,7 +1224,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
* Check that the @parent process has sufficient permission to trace the
* current process before allowing the current process to present itself
* to the @parent process for tracing.
* The parent process will still have to undergo the ptrace_may_access
* The parent process will still have to undergo the ptrace_access_check
* checks before it is allowed to trace this one.
* @parent contains the task_struct structure for debugger process.
* Return 0 if permission is granted.
Expand Down Expand Up @@ -1336,7 +1336,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
struct security_operations {
char name[SECURITY_NAME_MAX + 1];

int (*ptrace_may_access) (struct task_struct *child, unsigned int mode);
int (*ptrace_access_check) (struct task_struct *child, unsigned int mode);
int (*ptrace_traceme) (struct task_struct *parent);
int (*capget) (struct task_struct *target,
kernel_cap_t *effective,
Expand Down Expand Up @@ -1617,7 +1617,7 @@ extern int security_module_enable(struct security_operations *ops);
extern int register_security(struct security_operations *ops);

/* Security operations */
int security_ptrace_may_access(struct task_struct *child, unsigned int mode);
int security_ptrace_access_check(struct task_struct *child, unsigned int mode);
int security_ptrace_traceme(struct task_struct *parent);
int security_capget(struct task_struct *target,
kernel_cap_t *effective,
Expand Down Expand Up @@ -1798,10 +1798,10 @@ static inline int security_init(void)
return 0;
}

static inline int security_ptrace_may_access(struct task_struct *child,
static inline int security_ptrace_access_check(struct task_struct *child,
unsigned int mode)
{
return cap_ptrace_may_access(child, mode);
return cap_ptrace_access_check(child, mode);
}

static inline int security_ptrace_traceme(struct task_struct *parent)
Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ int __ptrace_may_access(struct task_struct *task, unsigned int mode)
if (!dumpable && !capable(CAP_SYS_PTRACE))
return -EPERM;

return security_ptrace_may_access(task, mode);
return security_ptrace_access_check(task, mode);
}

bool ptrace_may_access(struct task_struct *task, unsigned int mode)
Expand Down
2 changes: 1 addition & 1 deletion trunk/security/capability.c
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ struct security_operations default_security_ops = {

void security_fixup_ops(struct security_operations *ops)
{
set_to_cap_if_null(ops, ptrace_may_access);
set_to_cap_if_null(ops, ptrace_access_check);
set_to_cap_if_null(ops, ptrace_traceme);
set_to_cap_if_null(ops, capget);
set_to_cap_if_null(ops, capset);
Expand Down
4 changes: 2 additions & 2 deletions trunk/security/commoncap.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ int cap_settime(struct timespec *ts, struct timezone *tz)
}

/**
* cap_ptrace_may_access - Determine whether the current process may access
* cap_ptrace_access_check - Determine whether the current process may access
* another
* @child: The process to be accessed
* @mode: The mode of attachment.
*
* Determine whether a process may access another, returning 0 if permission
* granted, -ve if denied.
*/
int cap_ptrace_may_access(struct task_struct *child, unsigned int mode)
int cap_ptrace_access_check(struct task_struct *child, unsigned int mode)
{
int ret = 0;

Expand Down
4 changes: 2 additions & 2 deletions trunk/security/security.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ int register_security(struct security_operations *ops)

/* Security operations */

int security_ptrace_may_access(struct task_struct *child, unsigned int mode)
int security_ptrace_access_check(struct task_struct *child, unsigned int mode)
{
return security_ops->ptrace_may_access(child, mode);
return security_ops->ptrace_access_check(child, mode);
}

int security_ptrace_traceme(struct task_struct *parent)
Expand Down
6 changes: 3 additions & 3 deletions trunk/security/selinux/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -1854,12 +1854,12 @@ static inline u32 open_file_to_av(struct file *file)

/* Hook functions begin here. */

static int selinux_ptrace_may_access(struct task_struct *child,
static int selinux_ptrace_access_check(struct task_struct *child,
unsigned int mode)
{
int rc;

rc = cap_ptrace_may_access(child, mode);
rc = cap_ptrace_access_check(child, mode);
if (rc)
return rc;

Expand Down Expand Up @@ -5315,7 +5315,7 @@ static int selinux_key_getsecurity(struct key *key, char **_buffer)
static struct security_operations selinux_ops = {
.name = "selinux",

.ptrace_may_access = selinux_ptrace_may_access,
.ptrace_access_check = selinux_ptrace_access_check,
.ptrace_traceme = selinux_ptrace_traceme,
.capget = selinux_capget,
.capset = selinux_capset,
Expand Down
8 changes: 4 additions & 4 deletions trunk/security/smack/smack_lsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,21 @@ struct inode_smack *new_inode_smack(char *smack)
*/

/**
* smack_ptrace_may_access - Smack approval on PTRACE_ATTACH
* smack_ptrace_access_check - Smack approval on PTRACE_ATTACH
* @ctp: child task pointer
* @mode: ptrace attachment mode
*
* Returns 0 if access is OK, an error code otherwise
*
* Do the capability checks, and require read and write.
*/
static int smack_ptrace_may_access(struct task_struct *ctp, unsigned int mode)
static int smack_ptrace_access_check(struct task_struct *ctp, unsigned int mode)
{
int rc;
struct smk_audit_info ad;
char *sp, *tsp;

rc = cap_ptrace_may_access(ctp, mode);
rc = cap_ptrace_access_check(ctp, mode);
if (rc != 0)
return rc;

Expand Down Expand Up @@ -3032,7 +3032,7 @@ static void smack_release_secctx(char *secdata, u32 seclen)
struct security_operations smack_ops = {
.name = "smack",

.ptrace_may_access = smack_ptrace_may_access,
.ptrace_access_check = smack_ptrace_access_check,
.ptrace_traceme = smack_ptrace_traceme,
.syslog = smack_syslog,

Expand Down

0 comments on commit 31eb435

Please sign in to comment.