aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/sysctl/kernel.txt4
-rw-r--r--fs/coredump.c8
2 files changed, 8 insertions, 4 deletions
diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt
index e5d528e0c46e..6fccb69c03e7 100644
--- a/Documentation/sysctl/kernel.txt
+++ b/Documentation/sysctl/kernel.txt
@@ -197,8 +197,8 @@ core_pattern is used to specify a core dumpfile pattern name.
197 %P global pid (init PID namespace) 197 %P global pid (init PID namespace)
198 %i tid 198 %i tid
199 %I global tid (init PID namespace) 199 %I global tid (init PID namespace)
200 %u uid 200 %u uid (in initial user namespace)
201 %g gid 201 %g gid (in initial user namespace)
202 %d dump mode, matches PR_SET_DUMPABLE and 202 %d dump mode, matches PR_SET_DUMPABLE and
203 /proc/sys/fs/suid_dumpable 203 /proc/sys/fs/suid_dumpable
204 %s signal number 204 %s signal number
diff --git a/fs/coredump.c b/fs/coredump.c
index bbbe139ab280..833a57bc856c 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -209,11 +209,15 @@ static int format_corename(struct core_name *cn, struct coredump_params *cprm)
209 break; 209 break;
210 /* uid */ 210 /* uid */
211 case 'u': 211 case 'u':
212 err = cn_printf(cn, "%d", cred->uid); 212 err = cn_printf(cn, "%u",
213 from_kuid(&init_user_ns,
214 cred->uid));
213 break; 215 break;
214 /* gid */ 216 /* gid */
215 case 'g': 217 case 'g':
216 err = cn_printf(cn, "%d", cred->gid); 218 err = cn_printf(cn, "%u",
219 from_kgid(&init_user_ns,
220 cred->gid));
217 break; 221 break;
218 case 'd': 222 case 'd':
219 err = cn_printf(cn, "%d", 223 err = cn_printf(cn, "%d",