All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] userns: clean up dead code on error paths
@ 2026-08-28  9:16 Tao Cui
  2026-08-28  9:16 ` [PATCH 1/2] userns: remove dead key_put() on the create_user_ns() error path Tao Cui
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Tao Cui @ 2026-08-28  9:16 UTC (permalink / raw)
  To: brauner; +Cc: jack, kees, cyphar, containers, linux-kernel, cuitao, cui.tao

From: Tao Cui <cuitao@kylinos.cn>

Two small cleanups on the create_user_ns() and map_write() error
paths.  Both remove code that provably cannot have an effect; no
behavior change.

  user_namespace.c:164-167: the key_put() at fail_keyring has been
  dead since it was copy-pasted from free_user_ns() in 2016
  (dbec28460a89); persistent_keyring_register is only ever assigned
  lazily from key_get_persistent(), long after create_user_ns().

  user_namespace.c:1110-1112: the map clearing at the out: label of
  map_write() only ever zeroes an already-zero map; the destination
  map is untouched on every error path, and a second write to a
  mapped namespace is rejected before parsing.

Compile-tested and A/B-tested on next-20260827: identical behavior
on vanilla and patched kernels for single-write map failures,
recovery writes and 300 rounds of userns create/destroy.

Tao Cui (2):
  userns: remove dead key_put() on the create_user_ns() error path
  userns: don't clear the install target map on map_write() failure

 kernel/user_namespace.c | 6 ------
 1 file changed, 6 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-08-31 13:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-28  9:16 [PATCH 0/2] userns: clean up dead code on error paths Tao Cui
2026-08-28  9:16 ` [PATCH 1/2] userns: remove dead key_put() on the create_user_ns() error path Tao Cui
2026-08-28  9:41   ` Jan Kara
2026-08-28 11:45   ` Bradley Morgan
2026-08-28  9:16 ` [PATCH 2/2] userns: don't clear the install target map on map_write() failure Tao Cui
2026-08-28  9:51   ` Jan Kara
2026-08-31 10:08     ` Christian Brauner
2026-08-31 13:08       ` Tao Cui
2026-08-28 13:34   ` Bradley Morgan
2026-08-31 10:12 ` (subset) [PATCH 0/2] userns: clean up dead code on error paths Christian Brauner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.