aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/base.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 138cff4b05dd..acd1960c28a2 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2991,6 +2991,11 @@ static int proc_gid_map_open(struct inode *inode, struct file *file)
2991 return proc_id_map_open(inode, file, &proc_gid_seq_operations); 2991 return proc_id_map_open(inode, file, &proc_gid_seq_operations);
2992} 2992}
2993 2993
2994static int proc_projid_map_open(struct inode *inode, struct file *file)
2995{
2996 return proc_id_map_open(inode, file, &proc_projid_seq_operations);
2997}
2998
2994static const struct file_operations proc_uid_map_operations = { 2999static const struct file_operations proc_uid_map_operations = {
2995 .open = proc_uid_map_open, 3000 .open = proc_uid_map_open,
2996 .write = proc_uid_map_write, 3001 .write = proc_uid_map_write,
@@ -3006,6 +3011,14 @@ static const struct file_operations proc_gid_map_operations = {
3006 .llseek = seq_lseek, 3011 .llseek = seq_lseek,
3007 .release = proc_id_map_release, 3012 .release = proc_id_map_release,
3008}; 3013};
3014
3015static const struct file_operations proc_projid_map_operations = {
3016 .open = proc_projid_map_open,
3017 .write = proc_projid_map_write,
3018 .read = seq_read,
3019 .llseek = seq_lseek,
3020 .release = proc_id_map_release,
3021};
3009#endif /* CONFIG_USER_NS */ 3022#endif /* CONFIG_USER_NS */
3010 3023
3011static int proc_pid_personality(struct seq_file *m, struct pid_namespace *ns, 3024static int proc_pid_personality(struct seq_file *m, struct pid_namespace *ns,
@@ -3113,6 +3126,7 @@ static const struct pid_entry tgid_base_stuff[] = {
3113#ifdef CONFIG_USER_NS 3126#ifdef CONFIG_USER_NS
3114 REG("uid_map", S_IRUGO|S_IWUSR, proc_uid_map_operations), 3127 REG("uid_map", S_IRUGO|S_IWUSR, proc_uid_map_operations),
3115 REG("gid_map", S_IRUGO|S_IWUSR, proc_gid_map_operations), 3128 REG("gid_map", S_IRUGO|S_IWUSR, proc_gid_map_operations),
3129 REG("projid_map", S_IRUGO|S_IWUSR, proc_projid_map_operations),
3116#endif 3130#endif
3117}; 3131};
3118 3132
@@ -3476,6 +3490,7 @@ static const struct pid_entry tid_base_stuff[] = {
3476#ifdef CONFIG_USER_NS 3490#ifdef CONFIG_USER_NS
3477 REG("uid_map", S_IRUGO|S_IWUSR, proc_uid_map_operations), 3491 REG("uid_map", S_IRUGO|S_IWUSR, proc_uid_map_operations),
3478 REG("gid_map", S_IRUGO|S_IWUSR, proc_gid_map_operations), 3492 REG("gid_map", S_IRUGO|S_IWUSR, proc_gid_map_operations),
3493 REG("projid_map", S_IRUGO|S_IWUSR, proc_projid_map_operations),
3479#endif 3494#endif
3480}; 3495};
3481 3496