userns: Convert group_info values from gid_t to kgid_t.
As a first step to converting struct cred to be all kuid_t and kgid_t values convert the group values stored in group_info to always be kgid_t values. Unless user namespaces are used this change should have no effect. Acked-by: Serge Hallyn <serge.hallyn@canonical.com> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
This commit is contained in:
@@ -81,6 +81,7 @@
|
||||
#include <linux/pid_namespace.h>
|
||||
#include <linux/ptrace.h>
|
||||
#include <linux/tracehook.h>
|
||||
#include <linux/user_namespace.h>
|
||||
|
||||
#include <asm/pgtable.h>
|
||||
#include <asm/processor.h>
|
||||
@@ -161,6 +162,7 @@ static inline const char *get_task_state(struct task_struct *tsk)
|
||||
static inline void task_state(struct seq_file *m, struct pid_namespace *ns,
|
||||
struct pid *pid, struct task_struct *p)
|
||||
{
|
||||
struct user_namespace *user_ns = current_user_ns();
|
||||
struct group_info *group_info;
|
||||
int g;
|
||||
struct fdtable *fdt = NULL;
|
||||
@@ -205,7 +207,8 @@ static inline void task_state(struct seq_file *m, struct pid_namespace *ns,
|
||||
task_unlock(p);
|
||||
|
||||
for (g = 0; g < min(group_info->ngroups, NGROUPS_SMALL); g++)
|
||||
seq_printf(m, "%d ", GROUP_AT(group_info, g));
|
||||
seq_printf(m, "%d ",
|
||||
from_kgid_munged(user_ns, GROUP_AT(group_info, g)));
|
||||
put_cred(cred);
|
||||
|
||||
seq_putc(m, '\n');
|
||||
|
Reference in New Issue
Block a user