Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 192415
b: refs/heads/master
c: 43ed8c3
h: refs/heads/master
i:
  192413: 73a791d
  192411: 3f526b2
  192407: eac0bbb
  192399: cc6d698
  192383: 3f1a100
v: v3
  • Loading branch information
Eric Paris authored and James Morris committed Apr 12, 2010
1 parent c8e739b commit 2bcb2a9
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 47 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: 0968d0060a3c885e53d453380266c7792a55d302
refs/heads/master: 43ed8c3b4573d5f5cd314937fee63b4ab046ac5f
20 changes: 0 additions & 20 deletions trunk/include/linux/security.h
Original file line number Diff line number Diff line change
Expand Up @@ -674,18 +674,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
* userspace to load a kernel module with the given name.
* @kmod_name name of the module requested by the kernel
* Return 0 if successful.
* @task_setuid:
* Check permission before setting one or more of the user identity
* attributes of the current process. The @flags parameter indicates
* which of the set*uid system calls invoked this hook and how to
* interpret the @id0, @id1, and @id2 parameters. See the LSM_SETID
* definitions at the beginning of this file for the @flags values and
* their meanings.
* @id0 contains a uid.
* @id1 contains a uid.
* @id2 contains a uid.
* @flags contains one of the LSM_SETID_* values.
* Return 0 if permission is granted.
* @task_fix_setuid:
* Update the module's state after setting one or more of the user
* identity attributes of the current process. The @flags parameter
Expand Down Expand Up @@ -1536,7 +1524,6 @@ struct security_operations {
int (*kernel_act_as)(struct cred *new, u32 secid);
int (*kernel_create_files_as)(struct cred *new, struct inode *inode);
int (*kernel_module_request)(char *kmod_name);
int (*task_setuid) (uid_t id0, uid_t id1, uid_t id2, int flags);
int (*task_fix_setuid) (struct cred *new, const struct cred *old,
int flags);
int (*task_setgid) (gid_t id0, gid_t id1, gid_t id2, int flags);
Expand Down Expand Up @@ -1793,7 +1780,6 @@ void security_transfer_creds(struct cred *new, const struct cred *old);
int security_kernel_act_as(struct cred *new, u32 secid);
int security_kernel_create_files_as(struct cred *new, struct inode *inode);
int security_kernel_module_request(char *kmod_name);
int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags);
int security_task_fix_setuid(struct cred *new, const struct cred *old,
int flags);
int security_task_setgid(gid_t id0, gid_t id1, gid_t id2, int flags);
Expand Down Expand Up @@ -2330,12 +2316,6 @@ static inline int security_kernel_module_request(char *kmod_name)
return 0;
}

static inline int security_task_setuid(uid_t id0, uid_t id1, uid_t id2,
int flags)
{
return 0;
}

static inline int security_task_fix_setuid(struct cred *new,
const struct cred *old,
int flags)
Expand Down
15 changes: 0 additions & 15 deletions trunk/kernel/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,10 +609,6 @@ SYSCALL_DEFINE2(setreuid, uid_t, ruid, uid_t, euid)
return -ENOMEM;
old = current_cred();

retval = security_task_setuid(ruid, euid, (uid_t)-1, LSM_SETID_RE);
if (retval)
goto error;

retval = -EPERM;
if (ruid != (uid_t) -1) {
new->uid = ruid;
Expand Down Expand Up @@ -674,10 +670,6 @@ SYSCALL_DEFINE1(setuid, uid_t, uid)
return -ENOMEM;
old = current_cred();

retval = security_task_setuid(uid, (uid_t)-1, (uid_t)-1, LSM_SETID_ID);
if (retval)
goto error;

retval = -EPERM;
if (capable(CAP_SETUID)) {
new->suid = new->uid = uid;
Expand Down Expand Up @@ -718,9 +710,6 @@ SYSCALL_DEFINE3(setresuid, uid_t, ruid, uid_t, euid, uid_t, suid)
if (!new)
return -ENOMEM;

retval = security_task_setuid(ruid, euid, suid, LSM_SETID_RES);
if (retval)
goto error;
old = current_cred();

retval = -EPERM;
Expand Down Expand Up @@ -850,9 +839,6 @@ SYSCALL_DEFINE1(setfsuid, uid_t, uid)
old = current_cred();
old_fsuid = old->fsuid;

if (security_task_setuid(uid, (uid_t)-1, (uid_t)-1, LSM_SETID_FS) < 0)
goto error;

if (uid == old->uid || uid == old->euid ||
uid == old->suid || uid == old->fsuid ||
capable(CAP_SETUID)) {
Expand All @@ -863,7 +849,6 @@ SYSCALL_DEFINE1(setfsuid, uid_t, uid)
}
}

error:
abort_creds(new);
return old_fsuid;

Expand Down
6 changes: 0 additions & 6 deletions trunk/security/capability.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,11 +392,6 @@ static int cap_kernel_module_request(char *kmod_name)
return 0;
}

static int cap_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags)
{
return 0;
}

static int cap_task_setgid(gid_t id0, gid_t id1, gid_t id2, int flags)
{
return 0;
Expand Down Expand Up @@ -972,7 +967,6 @@ void security_fixup_ops(struct security_operations *ops)
set_to_cap_if_null(ops, kernel_act_as);
set_to_cap_if_null(ops, kernel_create_files_as);
set_to_cap_if_null(ops, kernel_module_request);
set_to_cap_if_null(ops, task_setuid);
set_to_cap_if_null(ops, task_fix_setuid);
set_to_cap_if_null(ops, task_setgid);
set_to_cap_if_null(ops, task_setpgid);
Expand Down
5 changes: 0 additions & 5 deletions trunk/security/security.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,11 +732,6 @@ int security_kernel_module_request(char *kmod_name)
return security_ops->kernel_module_request(kmod_name);
}

int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags)
{
return security_ops->task_setuid(id0, id1, id2, flags);
}

int security_task_fix_setuid(struct cred *new, const struct cred *old,
int flags)
{
Expand Down

0 comments on commit 2bcb2a9

Please sign in to comment.