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

Christian Brauner posted 3 patches 1 month ago
Documentation/admin-guide/binfmt-misc.rst        |   3 +
fs/binfmt_misc.c                                 |  12 ++-
tools/testing/selftests/exec/Makefile            |   4 +
tools/testing/selftests/exec/binfmt_misc_delim.c | 127 +++++++++++++++++++++++
4 files changed, 143 insertions(+), 3 deletions(-)
[PATCH 0/3] binfmt_misc: only let punctuation delimit a register string
Posted by Christian Brauner 1 month ago
Currently we accept arbitrary delimiters which really makes no sense and
from looking around it's an unused feature. Everytime we add a flag the
number of possible delimiter shrinks and it makes extensions much more
hazardous than they need to be. Stop it and only accept punctional as
delimiters.

This extends commit 8e85d50ba111 ("binfmt_misc: reject a flag character
as the field delimiter").

Letters, digits, whitespace, control characters, bytes above 0x7f and
the backslash now get -EINVAL. Everything deployed uses ':' anyway.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
---
Christian Brauner (3):
      binfmt_misc: only let punctuation delimit a register string
      selftests/exec: test delimiter restrictions
      binfmt_misc: document the field delimiter

 Documentation/admin-guide/binfmt-misc.rst        |   3 +
 fs/binfmt_misc.c                                 |  12 ++-
 tools/testing/selftests/exec/Makefile            |   4 +
 tools/testing/selftests/exec/binfmt_misc_delim.c | 127 +++++++++++++++++++++++
 4 files changed, 143 insertions(+), 3 deletions(-)
---
base-commit: 66498c75b4f8017f62d720d9b59675bdf3abce91
change-id: 20260810-work-binfmt_misc-delim-83f62cbcfe23
Re: [PATCH 0/3] binfmt_misc: only let punctuation delimit a register string
Posted by Farid Zakaria 1 month ago
On Wed, 26 Aug 2026 17:55:45 +0200, Christian Brauner <brauner@kernel.org> wrote:
> [...]
>  tools/testing/selftests/exec/Makefile            |   4 +
>  tools/testing/selftests/exec/binfmt_misc_delim.c | 127 +++++++++++++++++++++++
>  4 files changed, 143 insertions(+), 3 deletions(-)
> ---
> base-commit: 66498c75b4f8017f62d720d9b59675bdf3abce91
> change-id: 20260810-work-binfmt_misc-delim-83f62cbcfe23

Makes sense.
I think it's still pretty accepting when you consider all the
punctuation characeters even allowed :)

-- 
Farid Zakaria <farid.m.zakaria@gmail.com>