[PATCH v7 1/9] coredump: massage format_corname()

Jann Horn jannh at google.com
Thu May 15 20:52:49 UTC 2025


On Thu, May 15, 2025 at 12:04 AM Christian Brauner <brauner at kernel.org> wrote:
> We're going to extend the coredump code in follow-up patches.
> Clean it up so we can do this more easily.

typo nit: format_corename() written wrong in patch title

> Signed-off-by: Christian Brauner <brauner at kernel.org>

Reviewed-by: Jann Horn <jannh at google.com>

> @@ -384,12 +393,12 @@ static int format_corename(struct core_name *cn, struct coredump_params *cprm,
>          * If core_pattern does not include a %p (as is the default)
>          * and core_uses_pid is set, then .%pid will be appended to
>          * the filename. Do not do this for piped commands. */
> -       if (!ispipe && !pid_in_pattern && core_uses_pid) {
> +       if (!(cn->core_type == COREDUMP_PIPE) && !pid_in_pattern && core_uses_pid) {

non-actionable note: "!(cn->core_type == COREDUMP_PIPE)" can be
simplified to "cn->core_type != COREDUMP_PIPE"; but patch 4 rewrites
this anyway, so no need to change this



More information about the Linux-security-module-archive mailing list