Re: [RFC PATCH v10 01/28] userns: Factor out idmap validation and commit helpers

From: bot+bpf-ci

Date: Fri Dec 04 2026 - 23:02:17 EST


> userns: Factor out idmap validation and commit helpers

TL;DR: Commit message only: it claims "no functional change", but the
extent-limit check and the map_write() error-path cleanup were rewritten. It
asks the author to say so and explain why they are equivalent.

> userns: Factor out idmap validation and commit helpers
>
> map_write() and its permission helpers validate extent ranges, check
> root and unprivileged self-mappings, translate parent ID ranges, sort
> extents, and install the resulting map inline for procfs text writes,
> preventing non-procfs callers from reusing the same validation and
> commit path.
>
> Extract idmap_maps_root(), unpriv_idmap_permitted(),
> validate_and_insert_extent(), free_new_idmap(), resolve_new_idmap(), and
> commit_new_idmap() with no functional change.
>
> Signed-off-by: Jarkko Sakkinen <jarkko@xxxxxxxxxx>

This isn't a bug, but the changelog says "no functional change" while two
spots are rewritten rather than moved.

The extent-limit check went from:

(new_map.nr_extents + 1) == UID_GID_MAP_MAX_EXTENTS && (next_line != NULL)

to:

new_map->nr_extents >= UID_GID_MAP_MAX_EXTENTS

so it no longer depends on next_line. The error path in map_write() also
no longer resets map->forward, map->reverse and map->nr_extents.

Could the changelog say briefly that these two were changed, and why each
is equivalent to the old code?


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/47474652355