Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 311733
b: refs/heads/master
c: 8c84bf4
h: refs/heads/master
i:
  311731: f2662fd
v: v3
  • Loading branch information
Linus Torvalds committed Jul 8, 2012
1 parent 3d480b0 commit 1618255
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 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: 5db9a4d99b0157a513944e9a44d29c9cec2e91dc
refs/heads/master: 8c84bf4166a4698296342841a549bbee03860ac0
7 changes: 7 additions & 0 deletions trunk/Documentation/prctl/no_new_privs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ 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 = -rc5
EXTRAVERSION = -rc6
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;
int error, fput_needed;

error = -EBADF;
file = fget(fd);
file = fget_raw_light(fd, &fput_needed);
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(file);
fput_light(file, fput_needed);
out:
return error;
}
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/prctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@
* 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

0 comments on commit 1618255

Please sign in to comment.