Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 120646
b: refs/heads/master
c: 1f29fae
h: refs/heads/master
v: v3
  • Loading branch information
Serge E. Hallyn authored and James Morris committed Nov 5, 2008
1 parent d28571a commit 0b6176a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e21e696edb498c7f7eed42ba3096f6bbe13927b6
refs/heads/master: 1f29fae29709b4668979e244c09b2fa78ff1ad59
4 changes: 4 additions & 0 deletions trunk/Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1459,6 +1459,10 @@ and is between 256 and 4096 characters. It is defined in the file
instruction doesn't work correctly and not to
use it.

no_file_caps Tells the kernel not to honor file capabilities. The
only way then for a file to be executed with privilege
is to be setuid root or executed by root.

nohalt [IA-64] Tells the kernel not to use the power saving
function PAL_HALT_LIGHT when idle. This increases
power-consumption. On the positive side, it reduces
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/capability.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ typedef struct __user_cap_data_struct {
#define VFS_CAP_U32 VFS_CAP_U32_2
#define VFS_CAP_REVISION VFS_CAP_REVISION_2

#ifdef CONFIG_SECURITY_FILE_CAPABILITIES
extern int file_caps_enabled;
#endif

struct vfs_cap_data {
__le32 magic_etc; /* Little endian */
Expand Down
11 changes: 11 additions & 0 deletions trunk/kernel/capability.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ EXPORT_SYMBOL(__cap_empty_set);
EXPORT_SYMBOL(__cap_full_set);
EXPORT_SYMBOL(__cap_init_eff_set);

#ifdef CONFIG_SECURITY_FILE_CAPABILITIES
int file_caps_enabled = 1;

static int __init file_caps_disable(char *str)
{
file_caps_enabled = 0;
return 1;
}
__setup("no_file_caps", file_caps_disable);
#endif

/*
* More recent versions of libcap are available from:
*
Expand Down
3 changes: 3 additions & 0 deletions trunk/security/commoncap.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@ static int get_file_caps(struct linux_binprm *bprm)

bprm_clear_caps(bprm);

if (!file_caps_enabled)
return 0;

if (bprm->file->f_vfsmnt->mnt_flags & MNT_NOSUID)
return 0;

Expand Down

0 comments on commit 0b6176a

Please sign in to comment.