Re: [PATCH RESENT] coredump: fix cn_printf formatting warnings

From: Joe Perches
Date: Thu Apr 16 2015 - 06:50:31 EST


(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",



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/