linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] fs, close_range: add flag CLOSE_RANGE_CLOEXEC
@ 2020-10-13 14:06 Giuseppe Scrivano
  2020-10-13 14:06 ` [PATCH 1/2] " Giuseppe Scrivano
  2020-10-13 14:06 ` [PATCH 2/2] selftests: add tests for CLOSE_RANGE_CLOEXEC Giuseppe Scrivano
  0 siblings, 2 replies; 11+ messages in thread
From: Giuseppe Scrivano @ 2020-10-13 14:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: viro, linux-fsdevel, christian.brauner, containers

When the new flag is used, close_range will set the close-on-exec bit
for the file descriptors instead of close()-ing them.

It is useful for e.g. container runtimes that want to minimize the
number of syscalls used after a seccomp profile is installed but want
to keep some fds open until the container process is executed.

Giuseppe Scrivano (2):
  fs, close_range: add flag CLOSE_RANGE_CLOEXEC
  selftests: add tests for CLOSE_RANGE_CLOEXEC

 fs/file.c                                     | 56 +++++++++++++------
 include/uapi/linux/close_range.h              |  3 +
 .../testing/selftests/core/close_range_test.c | 44 +++++++++++++++
 3 files changed, 86 insertions(+), 17 deletions(-)

-- 
2.26.2


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

end of thread, other threads:[~2020-10-14  9:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-13 14:06 [PATCH 0/2] fs, close_range: add flag CLOSE_RANGE_CLOEXEC Giuseppe Scrivano
2020-10-13 14:06 ` [PATCH 1/2] " Giuseppe Scrivano
2020-10-13 20:54   ` Christian Brauner
2020-10-13 21:04     ` Rasmus Villemoes
2020-10-13 21:22       ` Christian Brauner
2020-10-13 22:45     ` Giuseppe Scrivano
2020-10-13 21:09   ` Al Viro
2020-10-13 21:32     ` Christian Brauner
2020-10-13 21:49     ` Rasmus Villemoes
2020-10-13 14:06 ` [PATCH 2/2] selftests: add tests for CLOSE_RANGE_CLOEXEC Giuseppe Scrivano
2020-10-13 15:22   ` David Laight

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).