Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 311731
b: refs/heads/master
c: 7db5b3c
h: refs/heads/master
i:
  311729: 4346c44
  311727: 2495d2d
v: v3
  • Loading branch information
Tejun Heo committed Jul 7, 2012
1 parent 4c16001 commit f2662fd
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 28 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: bd0a521e88aa7a06ae7aabaed7ae196ed4ad867a
refs/heads/master: 7db5b3ca0ecdb2e8fad52a4770e4e320e61c77a6
7 changes: 0 additions & 7 deletions trunk/Documentation/prctl/no_new_privs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ bits will no longer change the uid or gid; file capabilities will not
add to the permitted set, and LSMs will not relax constraints after
execve.

To set no_new_privs, use prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0).

Be careful, though: LSMs might also not tighten constraints on exec
in no_new_privs mode. (This means that setting up a general-purpose
service launcher to set no_new_privs before execing daemons may
interfere with LSM-based sandboxing.)

Note that no_new_privs does not prevent privilege changes that do not
involve execve. An appropriately privileged task can still call
setuid(2) and receive SCM_RIGHTS datagrams.
Expand Down
2 changes: 1 addition & 1 deletion trunk/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VERSION = 3
PATCHLEVEL = 5
SUBLEVEL = 0
EXTRAVERSION = -rc6
EXTRAVERSION = -rc5
NAME = Saber-toothed Squirrel

# *DOCUMENTATION*
Expand Down
6 changes: 3 additions & 3 deletions trunk/fs/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,10 +397,10 @@ SYSCALL_DEFINE1(fchdir, unsigned int, fd)
{
struct file *file;
struct inode *inode;
int error, fput_needed;
int error;

error = -EBADF;
file = fget_raw_light(fd, &fput_needed);
file = fget(fd);
if (!file)
goto out;

Expand All @@ -414,7 +414,7 @@ SYSCALL_DEFINE1(fchdir, unsigned int, fd)
if (!error)
set_fs_pwd(current->fs, &file->f_path);
out_putf:
fput_light(file, fput_needed);
fput(file);
out:
return error;
}
Expand Down
2 changes: 0 additions & 2 deletions trunk/include/linux/prctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@
* Changing LSM security domain is considered a new privilege. So, for example,
* asking selinux for a specific new context (e.g. with runcon) will result
* in execve returning -EPERM.
*
* See Documentation/prctl/no_new_privs.txt for more details.
*/
#define PR_SET_NO_NEW_PRIVS 38
#define PR_GET_NO_NEW_PRIVS 39
Expand Down
17 changes: 3 additions & 14 deletions trunk/kernel/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -901,13 +901,10 @@ static void cgroup_diput(struct dentry *dentry, struct inode *inode)
mutex_unlock(&cgroup_mutex);

/*
* We want to drop the active superblock reference from the
* cgroup creation after all the dentry refs are gone -
* kill_sb gets mighty unhappy otherwise. Mark
* dentry->d_fsdata with cgroup_diput() to tell
* cgroup_d_release() to call deactivate_super().
* Drop the active superblock reference that we took when we
* created the cgroup
*/
dentry->d_fsdata = cgroup_diput;
deactivate_super(cgrp->root->sb);

/*
* if we're getting rid of the cgroup, refcount should ensure
Expand All @@ -933,13 +930,6 @@ static int cgroup_delete(const struct dentry *d)
return 1;
}

static void cgroup_d_release(struct dentry *dentry)
{
/* did cgroup_diput() tell me to deactivate super? */
if (dentry->d_fsdata == cgroup_diput)
deactivate_super(dentry->d_sb);
}

static void remove_dir(struct dentry *d)
{
struct dentry *parent = dget(d->d_parent);
Expand Down Expand Up @@ -1547,7 +1537,6 @@ static int cgroup_get_rootdir(struct super_block *sb)
static const struct dentry_operations cgroup_dops = {
.d_iput = cgroup_diput,
.d_delete = cgroup_delete,
.d_release = cgroup_d_release,
};

struct inode *inode =
Expand Down

0 comments on commit f2662fd

Please sign in to comment.