linux/tools/testing
Christian Brauner 4ee7588bbb
selftests/core: test CLOSE_RANGE_EXCEPT
Cover the inverted range:

- with plain close the window stays and everything outside of it goes,
  stdio included

- a window at the top, one that cannot hold a descriptor and one of a
  single descriptor keep just what they name, and so does the unshare
  form on a table that is not shared

- with CLOSE_RANGE_CLOEXEC everything outside of the window is marked
  and the window is not, in place and in a clone, for a
  window in the middle, at the bottom, at the top and above the table

- with CLOSE_RANGE_UNSHARE the table the child cloned from is untouched,
  a window near the top of the table comes back whole, one at the bottom
  keeps stdio, one that cannot hold a descriptor keeps nothing, and the
  slots left behind are handed out again from the bottom

- the bounds are checked before the range is turned around

The extra cases came out of walking the window positions that
__range_close(), __range_cloexec() and dup_fd() tell apart: at the
bottom, in the middle, at the top, above the table, a single descriptor
and none, on a shared and on a private table.

Link: https://patch.msgid.link/20260921-work-file-close_range_except-v1-7-c20d0b49270d@kernel.org
Reviewed-by: Jann Horn <jannh@google.com>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2026-10-05 13:02:40 +02:00
..
crypto/chacha20-s390
cxl Merge branch 'for-7.3/cxl-misc' into cxl-for-next 2026-08-05 13:23:52 -07:00
fault-injection
ktest
kunit spi: Updates for v7.3 2026-08-19 09:47:41 -07:00
memblock kho: make boot time huge page allocation work nicely with KHO 2026-08-23 09:17:38 -07:00
nvdimm nvdimm: ndtest: remove redundant NULL check before vfree() 2026-07-14 16:12:53 -07:00
radix-tree maple_tree: change two GFP flags in tests 2026-08-24 18:43:31 -07:00
rbtree
scatterlist
selftests selftests/core: test CLOSE_RANGE_EXCEPT 2026-10-05 13:02:40 +02:00
shared mm/slab: improve kmem_cache_alloc_bulk 2026-06-03 18:20:43 +02:00
vma mm: fix CONFIG_STACK_GROWSUP typo in tools/testing/vma/include/dup.h 2026-08-24 18:43:12 -07:00
vsock vsock/test: add test for small packets under pressure 2026-07-21 12:11:06 +02:00