Skip to content

Commit cbacc2c

Browse files
committed
Merge branch 'next' into for-linus
2 parents 4a6908a + 7419224 commit cbacc2c

223 files changed

Lines changed: 5678 additions & 3322 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/credentials.txt‎

Lines changed: 582 additions & 0 deletions
Large diffs are not rendered by default.

‎Documentation/kernel-parameters.txt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,6 +1452,10 @@ and is between 256 and 4096 characters. It is defined in the file
14521452
instruction doesn't work correctly and not to
14531453
use it.
14541454

1455+
no_file_caps Tells the kernel not to honor file capabilities. The
1456+
only way then for a file to be executed with privilege
1457+
is to be setuid root or executed by root.
1458+
14551459
nohalt [IA-64] Tells the kernel not to use the power saving
14561460
function PAL_HALT_LIGHT when idle. This increases
14571461
power-consumption. On the positive side, it reduces

‎Documentation/scheduler/sched-design-CFS.txt‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,3 +273,24 @@ task groups and modify their CPU share using the "cgroups" pseudo filesystem.
273273

274274
# #Launch gmplayer (or your favourite movie player)
275275
# echo <movie_player_pid> > multimedia/tasks
276+
277+
8. Implementation note: user namespaces
278+
279+
User namespaces are intended to be hierarchical. But they are currently
280+
only partially implemented. Each of those has ramifications for CFS.
281+
282+
First, since user namespaces are hierarchical, the /sys/kernel/uids
283+
presentation is inadequate. Eventually we will likely want to use sysfs
284+
tagging to provide private views of /sys/kernel/uids within each user
285+
namespace.
286+
287+
Second, the hierarchical nature is intended to support completely
288+
unprivileged use of user namespaces. So if using user groups, then
289+
we want the users in a user namespace to be children of the user
290+
who created it.
291+
292+
That is currently unimplemented. So instead, every user in a new
293+
user namespace will receive 1024 shares just like any user in the
294+
initial user namespace. Note that at the moment creation of a new
295+
user namespace requires each of CAP_SYS_ADMIN, CAP_SETUID, and
296+
CAP_SETGID.

‎arch/alpha/kernel/asm-offsets.c‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,18 @@ void foo(void)
1919
BLANK();
2020

2121
DEFINE(TASK_BLOCKED, offsetof(struct task_struct, blocked));
22-
DEFINE(TASK_UID, offsetof(struct task_struct, uid));
23-
DEFINE(TASK_EUID, offsetof(struct task_struct, euid));
24-
DEFINE(TASK_GID, offsetof(struct task_struct, gid));
25-
DEFINE(TASK_EGID, offsetof(struct task_struct, egid));
22+
DEFINE(TASK_CRED, offsetof(struct task_struct, cred));
2623
DEFINE(TASK_REAL_PARENT, offsetof(struct task_struct, real_parent));
2724
DEFINE(TASK_GROUP_LEADER, offsetof(struct task_struct, group_leader));
2825
DEFINE(TASK_TGID, offsetof(struct task_struct, tgid));
2926
BLANK();
3027

28+
DEFINE(CRED_UID, offsetof(struct cred, uid));
29+
DEFINE(CRED_EUID, offsetof(struct cred, euid));
30+
DEFINE(CRED_GID, offsetof(struct cred, gid));
31+
DEFINE(CRED_EGID, offsetof(struct cred, egid));
32+
BLANK();
33+
3134
DEFINE(SIZEOF_PT_REGS, sizeof(struct pt_regs));
3235
DEFINE(PT_PTRACED, PT_PTRACED);
3336
DEFINE(CLONE_VM, CLONE_VM);

‎arch/alpha/kernel/entry.S‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -850,8 +850,9 @@ osf_getpriority:
850850
sys_getxuid:
851851
.prologue 0
852852
ldq $2, TI_TASK($8)
853-
ldl $0, TASK_UID($2)
854-
ldl $1, TASK_EUID($2)
853+
ldq $3, TASK_CRED($2)
854+
ldl $0, CRED_UID($3)
855+
ldl $1, CRED_EUID($3)
855856
stq $1, 80($sp)
856857
ret
857858
.end sys_getxuid
@@ -862,8 +863,9 @@ sys_getxuid:
862863
sys_getxgid:
863864
.prologue 0
864865
ldq $2, TI_TASK($8)
865-
ldl $0, TASK_GID($2)
866-
ldl $1, TASK_EGID($2)
866+
ldq $3, TASK_CRED($2)
867+
ldl $0, CRED_GID($3)
868+
ldl $1, CRED_EGID($3)
867869
stq $1, 80($sp)
868870
ret
869871
.end sys_getxgid

‎arch/ia64/ia32/sys_ia32.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,25 +1767,24 @@ groups16_from_user(struct group_info *group_info, short __user *grouplist)
17671767
asmlinkage long
17681768
sys32_getgroups16 (int gidsetsize, short __user *grouplist)
17691769
{
1770+
const struct cred *cred = current_cred();
17701771
int i;
17711772

17721773
if (gidsetsize < 0)
17731774
return -EINVAL;
17741775

1775-
get_group_info(current->group_info);
1776-
i = current->group_info->ngroups;
1776+
i = cred->group_info->ngroups;
17771777
if (gidsetsize) {
17781778
if (i > gidsetsize) {
17791779
i = -EINVAL;
17801780
goto out;
17811781
}
1782-
if (groups16_to_user(grouplist, current->group_info)) {
1782+
if (groups16_to_user(grouplist, cred->group_info)) {
17831783
i = -EFAULT;
17841784
goto out;
17851785
}
17861786
}
17871787
out:
1788-
put_group_info(current->group_info);
17891788
return i;
17901789
}
17911790

‎arch/ia64/kernel/mca_drv.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ mca_handler_bh(unsigned long paddr, void *iip, unsigned long ipsr)
158158
ia64_mlogbuf_dump();
159159
printk(KERN_ERR "OS_MCA: process [cpu %d, pid: %d, uid: %d, "
160160
"iip: %p, psr: 0x%lx,paddr: 0x%lx](%s) encounters MCA.\n",
161-
raw_smp_processor_id(), current->pid, current->uid,
161+
raw_smp_processor_id(), current->pid, current_uid(),
162162
iip, ipsr, paddr, current->comm);
163163

164164
spin_lock(&mca_bh_lock);

‎arch/ia64/kernel/perfmon.c‎

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2220,8 +2220,8 @@ pfm_alloc_file(pfm_context_t *ctx)
22202220
DPRINT(("new inode ino=%ld @%p\n", inode->i_ino, inode));
22212221

22222222
inode->i_mode = S_IFCHR|S_IRUGO;
2223-
inode->i_uid = current->fsuid;
2224-
inode->i_gid = current->fsgid;
2223+
inode->i_uid = current_fsuid();
2224+
inode->i_gid = current_fsgid();
22252225

22262226
sprintf(name, "[%lu]", inode->i_ino);
22272227
this.name = name;
@@ -2399,22 +2399,33 @@ pfm_smpl_buffer_alloc(struct task_struct *task, struct file *filp, pfm_context_t
23992399
static int
24002400
pfm_bad_permissions(struct task_struct *task)
24012401
{
2402+
const struct cred *tcred;
2403+
uid_t uid = current_uid();
2404+
gid_t gid = current_gid();
2405+
int ret;
2406+
2407+
rcu_read_lock();
2408+
tcred = __task_cred(task);
2409+
24022410
/* inspired by ptrace_attach() */
24032411
DPRINT(("cur: uid=%d gid=%d task: euid=%d suid=%d uid=%d egid=%d sgid=%d\n",
2404-
current->uid,
2405-
current->gid,
2406-
task->euid,
2407-
task->suid,
2408-
task->uid,
2409-
task->egid,
2410-
task->sgid));
2411-
2412-
return ((current->uid != task->euid)
2413-
|| (current->uid != task->suid)
2414-
|| (current->uid != task->uid)
2415-
|| (current->gid != task->egid)
2416-
|| (current->gid != task->sgid)
2417-
|| (current->gid != task->gid)) && !capable(CAP_SYS_PTRACE);
2412+
uid,
2413+
gid,
2414+
tcred->euid,
2415+
tcred->suid,
2416+
tcred->uid,
2417+
tcred->egid,
2418+
tcred->sgid));
2419+
2420+
ret = ((uid != tcred->euid)
2421+
|| (uid != tcred->suid)
2422+
|| (uid != tcred->uid)
2423+
|| (gid != tcred->egid)
2424+
|| (gid != tcred->sgid)
2425+
|| (gid != tcred->gid)) && !capable(CAP_SYS_PTRACE);
2426+
2427+
rcu_read_unlock();
2428+
return ret;
24182429
}
24192430

24202431
static int

‎arch/ia64/kernel/signal.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ ia64_rt_sigreturn (struct sigscratch *scr)
229229
si.si_errno = 0;
230230
si.si_code = SI_KERNEL;
231231
si.si_pid = task_pid_vnr(current);
232-
si.si_uid = current->uid;
232+
si.si_uid = current_uid();
233233
si.si_addr = sc;
234234
force_sig_info(SIGSEGV, &si, current);
235235
return retval;
@@ -326,7 +326,7 @@ force_sigsegv_info (int sig, void __user *addr)
326326
si.si_errno = 0;
327327
si.si_code = SI_KERNEL;
328328
si.si_pid = task_pid_vnr(current);
329-
si.si_uid = current->uid;
329+
si.si_uid = current_uid();
330330
si.si_addr = addr;
331331
force_sig_info(SIGSEGV, &si, current);
332332
return 0;

‎arch/mips/kernel/kspd.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ static unsigned int translate_open_flags(int flags)
174174

175175
static void sp_setfsuidgid( uid_t uid, gid_t gid)
176176
{
177-
current->fsuid = uid;
178-
current->fsgid = gid;
177+
current->cred->fsuid = uid;
178+
current->cred->fsgid = gid;
179179

180180
key_fsuid_changed(current);
181181
key_fsgid_changed(current);

0 commit comments

Comments
 (0)