lkml.org 
[lkml]   [2015]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH RESENT] coredump: fix cn_printf formatting warnings
From
Date
(adding Andrew Morton to cc's)

On Thu, 2015-04-16 at 18:28 +0800, Nicolas Iooss wrote:
> Add __printf attributes to cn_*printf functions.

[]

> I sent this patch more than a month ago but go no feedback, so I'm sending it again.
> Comments would be greatly appreciated.

Seems sensible, but trivially, the uid/gid output
should use %u as uid_t/__kernel_uid32_t and
gid_t/__kernel_gid32_t are unsigned int

Also, this would probably be better as 2 patches.

One for the __printf and mismatches fixes,
Another for the _munged use.

> diff --git a/fs/coredump.c b/fs/coredump.c
[]
> @@ -209,11 +211,15 @@ static int format_corename(struct core_name *cn, struct coredump_params *cprm)
> break;
> /* uid */
> case 'u':
> - err = cn_printf(cn, "%d", cred->uid);
> + err = cn_printf(cn, "%d",
> + from_kuid_munged(cred->user_ns,
> + cred->uid));
> break;
> /* gid */
> case 'g':
> - err = cn_printf(cn, "%d", cred->gid);
> + err = cn_printf(cn, "%d",
> + from_kgid_munged(cred->user_ns,
> + cred->gid));
> break;
> case 'd':
> err = cn_printf(cn, "%d",





\
 
 \ /
  Last update: 2015-04-16 13:21    [W:0.169 / U:6.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site