diff options
| author | Christian Brauner <brauner@kernel.org> | 2026-09-21 16:15:35 +0200 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2026-10-05 13:02:40 +0200 |
| commit | 4ee7588bbbfa67ebea345e1e36fbb370872c1e53 (patch) | |
| tree | 757b11e4bc485662262d237075825831250d8113 /tools/lib/python | |
| parent | 6939539684ce6ee5cea49c9f2b22177a27c73c67 (diff) | |
| download | linux-next-4ee7588bbbfa67ebea345e1e36fbb370872c1e53.tar.gz linux-next-4ee7588bbbfa67ebea345e1e36fbb370872c1e53.zip | |
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>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
