Re: [PATCH 1/3] binfmt_misc: only let punctuation delimit a register string

From: Farid Zakaria

Date: Thu Aug 27 2026 - 23:53:43 EST


On Wed, 26 Aug 2026 17:55:46 +0200, Christian Brauner <brauner@xxxxxxxxxx> wrote:
> diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c
> index ddfd3aa57ac8..809c91d21b39 100644
> --- a/fs/binfmt_misc.c
> +++ b/fs/binfmt_misc.c
> @@ -100,6 +100,13 @@ static const struct binfmt_misc_flag *misc_flag_by_char(const char c)
> return NULL;
> }
>
> +static bool misc_valid_delim(const char c)
> +{
> + if (!isascii(c) || !ispunct(c))
> + return false;
> + return c != '\\';
> +}
> +

Is there a ready you did not make it a single && ?
Feels a bit weird to check the negative;

i.e. return isascii(c) && ispunct(c) && c != '\\';
(DeMorgan's law)

Reviewed-by: Farid Zakaria <farid.m.zakaria@xxxxxxxxx>

--
Farid Zakaria <farid.m.zakaria@xxxxxxxxx>