Generic Linux architectural discussions
 help / color / mirror / Atom feed
diff for duplicates of <20190523154747.15162-2-christian@brauner.io>

diff --git a/a/1.txt b/N1/1.txt
index 1cf7c88..6ca67a7 100644
--- a/a/1.txt
+++ b/N1/1.txt
@@ -94,417 +94,3 @@ be used to implement extension. Once can imagine userspace wanting to stop
 at the first error instead of ignoring errors under certain circumstances.
 There might be other valid ideas in the future. In any case, a flag
 argument doesn't hurt and keeps us on the safe side.
-
-From an implementation side this is kept rather dumb. It saw some input
-from David and Jann but all nonsense is obviously my own!
-- Errors to close file descriptors are currently ignored. (Could be changed
-  by setting a flag in the future if needed.)
-- __close_range() is a rather simplistic wrapper around __close_fd().
-  My reasoning behind this is based on the nature of how __close_fd() needs
-  to release an fd. But maybe I misunderstood specifics:
-  We take the files_lock and rcu-dereference the fdtable of the calling
-  task, we find the entry in the fdtable, get the file and need to release
-  files_lock before calling filp_close().
-  In the meantime the fdtable might have been altered so we can't just
-  retake the spinlock and keep the old rcu-reference of the fdtable
-  around. Instead we need to grab a fresh reference to the fdtable.
-  If my reasoning is correct then there's really no point in fancyfying
-  __close_range(): We just need to rcu-dereference the fdtable of the
-  calling task once to cap the max_fd value correctly and then go on
-  calling __close_fd() in a loop.
-
-/* References */
-[1]: https://lore.kernel.org/lkml/20190516165021.GD17978@ZenIV.linux.org.uk/
-[2]: https://github.com/python/cpython/blob/9e4f2f3a6b8ee995c365e86d976937c141d867f8/Modules/_posixsubprocess.c#L220
-[3]: https://sourceware.org/bugzilla/show_bug.cgi?id=10353#c7
-[4]: https://github.com/systemd/systemd/blob/5238e9575906297608ff802a27e2ff9effa3b338/src/basic/fd-util.c#L217
-[5]: https://github.com/lxc/lxc/blob/ddf4b77e11a4d08f09b7b9cd13e593f8c047edc5/src/lxc/start.c#L236
-[6]: https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/grantpt.c;h=2030e07fa6e652aac32c775b8c6e005844c3c4eb;hb=HEAD#l17
-     Note that this is an internal implementation that is not exported.
-     Currently, libc seems to not provide an exported version of this
-     because of missing kernel support to do this.
-[7]: https://github.com/rust-lang/rust/issues/12148
-[8]: https://github.com/rust-lang/rust/blob/5f47c0613ed4eb46fca3633c1297364c09e5e451/src/libstd/sys/unix/process2.rs#L303-L308
-     Rust's solution is slightly different but is equally unperformant.
-     Rust calls getdtablesize() which is a glibc library function that
-     simply returns the current RLIMIT_NOFILE or OPEN_MAX values. Rust then
-     goes on to call close() on each fd. That's obviously overkill for most
-     tasks. Rarely, tasks - especially non-demons - hit RLIMIT_NOFILE or
-     OPEN_MAX.
-     Let's be nice and assume an unprivileged user with RLIMIT_NOFILE set
-     to 1024. Even in this case, there's a very high chance that in the
-     common case Rust is calling the close() syscall 1021 times pointlessly
-     if the task just has 0, 1, and 2 open.
-
-Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
-Signed-off-by: Christian Brauner <christian@brauner.io>
-Cc: Arnd Bergmann <arnd@arndb.de>
-Cc: Jann Horn <jannh@google.com>
-Cc: David Howells <dhowells@redhat.com>
-Cc: Dmitry V. Levin <ldv@altlinux.org>
-Cc: Oleg Nesterov <oleg@redhat.com>
-Cc: Linus Torvalds <torvalds@linux-foundation.org>
-Cc: Florian Weimer <fweimer@redhat.com>
-Cc: linux-api@vger.kernel.org
----
-v1:
-- Linus Torvalds <torvalds@linux-foundation.org>:
-  - add cond_resched() to yield cpu when closing a lot of file descriptors
-- Al Viro <viro@zeniv.linux.org.uk>:
-  - add cond_resched() to yield cpu when closing a lot of file descriptors
-v2: unchanged
----
- arch/alpha/kernel/syscalls/syscall.tbl      |  1 +
- arch/arm/tools/syscall.tbl                  |  1 +
- arch/arm64/include/asm/unistd32.h           |  2 +
- arch/ia64/kernel/syscalls/syscall.tbl       |  1 +
- arch/m68k/kernel/syscalls/syscall.tbl       |  1 +
- arch/microblaze/kernel/syscalls/syscall.tbl |  1 +
- arch/mips/kernel/syscalls/syscall_n32.tbl   |  1 +
- arch/mips/kernel/syscalls/syscall_n64.tbl   |  1 +
- arch/mips/kernel/syscalls/syscall_o32.tbl   |  1 +
- arch/parisc/kernel/syscalls/syscall.tbl     |  1 +
- arch/powerpc/kernel/syscalls/syscall.tbl    |  1 +
- arch/s390/kernel/syscalls/syscall.tbl       |  1 +
- arch/sh/kernel/syscalls/syscall.tbl         |  1 +
- arch/sparc/kernel/syscalls/syscall.tbl      |  1 +
- arch/x86/entry/syscalls/syscall_32.tbl      |  1 +
- arch/x86/entry/syscalls/syscall_64.tbl      |  1 +
- arch/xtensa/kernel/syscalls/syscall.tbl     |  1 +
- fs/file.c                                   | 62 ++++++++++++++++++---
- fs/open.c                                   | 20 +++++++
- include/linux/fdtable.h                     |  2 +
- include/linux/syscalls.h                    |  2 +
- include/uapi/asm-generic/unistd.h           |  4 +-
- 22 files changed, 99 insertions(+), 9 deletions(-)
-
-diff --git a/arch/alpha/kernel/syscalls/syscall.tbl b/arch/alpha/kernel/syscalls/syscall.tbl
-index 9e7704e44f6d..b55d93af8096 100644
---- a/arch/alpha/kernel/syscalls/syscall.tbl
-+++ b/arch/alpha/kernel/syscalls/syscall.tbl
-@@ -473,3 +473,4 @@
- 541	common	fsconfig			sys_fsconfig
- 542	common	fsmount				sys_fsmount
- 543	common	fspick				sys_fspick
-+545	common	close_range			sys_close_range
-diff --git a/arch/arm/tools/syscall.tbl b/arch/arm/tools/syscall.tbl
-index aaf479a9e92d..0125c97c75dd 100644
---- a/arch/arm/tools/syscall.tbl
-+++ b/arch/arm/tools/syscall.tbl
-@@ -447,3 +447,4 @@
- 431	common	fsconfig			sys_fsconfig
- 432	common	fsmount				sys_fsmount
- 433	common	fspick				sys_fspick
-+435	common	close_range			sys_close_range
-diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h
-index c39e90600bb3..9a3270d29b42 100644
---- a/arch/arm64/include/asm/unistd32.h
-+++ b/arch/arm64/include/asm/unistd32.h
-@@ -886,6 +886,8 @@ __SYSCALL(__NR_fsconfig, sys_fsconfig)
- __SYSCALL(__NR_fsmount, sys_fsmount)
- #define __NR_fspick 433
- __SYSCALL(__NR_fspick, sys_fspick)
-+#define __NR_close_range 435
-+__SYSCALL(__NR_close_range, sys_close_range)
- 
- /*
-  * Please add new compat syscalls above this comment and update
-diff --git a/arch/ia64/kernel/syscalls/syscall.tbl b/arch/ia64/kernel/syscalls/syscall.tbl
-index e01df3f2f80d..1a90b464e96f 100644
---- a/arch/ia64/kernel/syscalls/syscall.tbl
-+++ b/arch/ia64/kernel/syscalls/syscall.tbl
-@@ -354,3 +354,4 @@
- 431	common	fsconfig			sys_fsconfig
- 432	common	fsmount				sys_fsmount
- 433	common	fspick				sys_fspick
-+435	common	close_range			sys_close_range
-diff --git a/arch/m68k/kernel/syscalls/syscall.tbl b/arch/m68k/kernel/syscalls/syscall.tbl
-index 7e3d0734b2f3..2dee2050f9ef 100644
---- a/arch/m68k/kernel/syscalls/syscall.tbl
-+++ b/arch/m68k/kernel/syscalls/syscall.tbl
-@@ -433,3 +433,4 @@
- 431	common	fsconfig			sys_fsconfig
- 432	common	fsmount				sys_fsmount
- 433	common	fspick				sys_fspick
-+435	common	close_range			sys_close_range
-diff --git a/arch/microblaze/kernel/syscalls/syscall.tbl b/arch/microblaze/kernel/syscalls/syscall.tbl
-index 26339e417695..923ef69e5a76 100644
---- a/arch/microblaze/kernel/syscalls/syscall.tbl
-+++ b/arch/microblaze/kernel/syscalls/syscall.tbl
-@@ -439,3 +439,4 @@
- 431	common	fsconfig			sys_fsconfig
- 432	common	fsmount				sys_fsmount
- 433	common	fspick				sys_fspick
-+435	common	close_range			sys_close_range
-diff --git a/arch/mips/kernel/syscalls/syscall_n32.tbl b/arch/mips/kernel/syscalls/syscall_n32.tbl
-index 0e2dd68ade57..967ed9de51cd 100644
---- a/arch/mips/kernel/syscalls/syscall_n32.tbl
-+++ b/arch/mips/kernel/syscalls/syscall_n32.tbl
-@@ -372,3 +372,4 @@
- 431	n32	fsconfig			sys_fsconfig
- 432	n32	fsmount				sys_fsmount
- 433	n32	fspick				sys_fspick
-+435	n32	close_range			sys_close_range
-diff --git a/arch/mips/kernel/syscalls/syscall_n64.tbl b/arch/mips/kernel/syscalls/syscall_n64.tbl
-index 5eebfa0d155c..71de731102b1 100644
---- a/arch/mips/kernel/syscalls/syscall_n64.tbl
-+++ b/arch/mips/kernel/syscalls/syscall_n64.tbl
-@@ -348,3 +348,4 @@
- 431	n64	fsconfig			sys_fsconfig
- 432	n64	fsmount				sys_fsmount
- 433	n64	fspick				sys_fspick
-+435	n64	close_range			sys_close_range
-diff --git a/arch/mips/kernel/syscalls/syscall_o32.tbl b/arch/mips/kernel/syscalls/syscall_o32.tbl
-index 3cc1374e02d0..5a325ab29f88 100644
---- a/arch/mips/kernel/syscalls/syscall_o32.tbl
-+++ b/arch/mips/kernel/syscalls/syscall_o32.tbl
-@@ -421,3 +421,4 @@
- 431	o32	fsconfig			sys_fsconfig
- 432	o32	fsmount				sys_fsmount
- 433	o32	fspick				sys_fspick
-+435	o32	close_range			sys_close_range
-diff --git a/arch/parisc/kernel/syscalls/syscall.tbl b/arch/parisc/kernel/syscalls/syscall.tbl
-index c9e377d59232..dcc0a0879139 100644
---- a/arch/parisc/kernel/syscalls/syscall.tbl
-+++ b/arch/parisc/kernel/syscalls/syscall.tbl
-@@ -430,3 +430,4 @@
- 431	common	fsconfig			sys_fsconfig
- 432	common	fsmount				sys_fsmount
- 433	common	fspick				sys_fspick
-+435	common	close_range			sys_close_range
-diff --git a/arch/powerpc/kernel/syscalls/syscall.tbl b/arch/powerpc/kernel/syscalls/syscall.tbl
-index 103655d84b4b..ba2c1f078cbd 100644
---- a/arch/powerpc/kernel/syscalls/syscall.tbl
-+++ b/arch/powerpc/kernel/syscalls/syscall.tbl
-@@ -515,3 +515,4 @@
- 431	common	fsconfig			sys_fsconfig
- 432	common	fsmount				sys_fsmount
- 433	common	fspick				sys_fspick
-+435	common	close_range			sys_close_range
-diff --git a/arch/s390/kernel/syscalls/syscall.tbl b/arch/s390/kernel/syscalls/syscall.tbl
-index e822b2964a83..d7c9043d2902 100644
---- a/arch/s390/kernel/syscalls/syscall.tbl
-+++ b/arch/s390/kernel/syscalls/syscall.tbl
-@@ -436,3 +436,4 @@
- 431  common	fsconfig		sys_fsconfig			sys_fsconfig
- 432  common	fsmount			sys_fsmount			sys_fsmount
- 433  common	fspick			sys_fspick			sys_fspick
-+435  common	close_range		sys_close_range			sys_close_range
-diff --git a/arch/sh/kernel/syscalls/syscall.tbl b/arch/sh/kernel/syscalls/syscall.tbl
-index 016a727d4357..9b5e6bf0ce32 100644
---- a/arch/sh/kernel/syscalls/syscall.tbl
-+++ b/arch/sh/kernel/syscalls/syscall.tbl
-@@ -436,3 +436,4 @@
- 431	common	fsconfig			sys_fsconfig
- 432	common	fsmount				sys_fsmount
- 433	common	fspick				sys_fspick
-+435	common	close_range			sys_close_range
-diff --git a/arch/sparc/kernel/syscalls/syscall.tbl b/arch/sparc/kernel/syscalls/syscall.tbl
-index e047480b1605..8c674a1e0072 100644
---- a/arch/sparc/kernel/syscalls/syscall.tbl
-+++ b/arch/sparc/kernel/syscalls/syscall.tbl
-@@ -479,3 +479,4 @@
- 431	common	fsconfig			sys_fsconfig
- 432	common	fsmount				sys_fsmount
- 433	common	fspick				sys_fspick
-+435	common	close_range			sys_close_range
-diff --git a/arch/x86/entry/syscalls/syscall_32.tbl b/arch/x86/entry/syscalls/syscall_32.tbl
-index ad968b7bac72..7f7a89a96707 100644
---- a/arch/x86/entry/syscalls/syscall_32.tbl
-+++ b/arch/x86/entry/syscalls/syscall_32.tbl
-@@ -438,3 +438,4 @@
- 431	i386	fsconfig		sys_fsconfig			__ia32_sys_fsconfig
- 432	i386	fsmount			sys_fsmount			__ia32_sys_fsmount
- 433	i386	fspick			sys_fspick			__ia32_sys_fspick
-+435	i386	close_range		sys_close_range			__ia32_sys_close_range
-diff --git a/arch/x86/entry/syscalls/syscall_64.tbl b/arch/x86/entry/syscalls/syscall_64.tbl
-index b4e6f9e6204a..0f7d47ae921c 100644
---- a/arch/x86/entry/syscalls/syscall_64.tbl
-+++ b/arch/x86/entry/syscalls/syscall_64.tbl
-@@ -355,6 +355,7 @@
- 431	common	fsconfig		__x64_sys_fsconfig
- 432	common	fsmount			__x64_sys_fsmount
- 433	common	fspick			__x64_sys_fspick
-+435	common	close_range		__x64_sys_close_range
- 
- #
- # x32-specific system call numbers start at 512 to avoid cache impact
-diff --git a/arch/xtensa/kernel/syscalls/syscall.tbl b/arch/xtensa/kernel/syscalls/syscall.tbl
-index 5fa0ee1c8e00..b489532265d0 100644
---- a/arch/xtensa/kernel/syscalls/syscall.tbl
-+++ b/arch/xtensa/kernel/syscalls/syscall.tbl
-@@ -404,3 +404,4 @@
- 431	common	fsconfig			sys_fsconfig
- 432	common	fsmount				sys_fsmount
- 433	common	fspick				sys_fspick
-+435	common	close_range			sys_close_range
-diff --git a/fs/file.c b/fs/file.c
-index 3da91a112bab..53430d68bbd7 100644
---- a/fs/file.c
-+++ b/fs/file.c
-@@ -10,6 +10,7 @@
- #include <linux/syscalls.h>
- #include <linux/export.h>
- #include <linux/fs.h>
-+#include <linux/kernel.h>
- #include <linux/mm.h>
- #include <linux/sched/signal.h>
- #include <linux/slab.h>
-@@ -615,12 +616,9 @@ void fd_install(unsigned int fd, struct file *file)
- 
- EXPORT_SYMBOL(fd_install);
- 
--/*
-- * The same warnings as for __alloc_fd()/__fd_install() apply here...
-- */
--int __close_fd(struct files_struct *files, unsigned fd)
-+static struct file *pick_file(struct files_struct *files, unsigned fd)
- {
--	struct file *file;
-+	struct file *file = NULL;
- 	struct fdtable *fdt;
- 
- 	spin_lock(&files->file_lock);
-@@ -632,15 +630,63 @@ int __close_fd(struct files_struct *files, unsigned fd)
- 		goto out_unlock;
- 	rcu_assign_pointer(fdt->fd[fd], NULL);
- 	__put_unused_fd(files, fd);
--	spin_unlock(&files->file_lock);
--	return filp_close(file, files);
- 
- out_unlock:
- 	spin_unlock(&files->file_lock);
--	return -EBADF;
-+	return file;
-+}
-+
-+/*
-+ * The same warnings as for __alloc_fd()/__fd_install() apply here...
-+ */
-+int __close_fd(struct files_struct *files, unsigned fd)
-+{
-+	struct file *file;
-+
-+	file = pick_file(files, fd);
-+	if (!file)
-+		return -EBADF;
-+
-+	return filp_close(file, files);
- }
- EXPORT_SYMBOL(__close_fd); /* for ksys_close() */
- 
-+/**
-+ * __close_range() - Close all file descriptors in a given range.
-+ *
-+ * @fd:     starting file descriptor to close
-+ * @max_fd: last file descriptor to close
-+ *
-+ * This closes a range of file descriptors. All file descriptors
-+ * from @fd up to and including @max_fd are closed.
-+ */
-+int __close_range(struct files_struct *files, unsigned fd, unsigned max_fd)
-+{
-+	unsigned int cur_max;
-+
-+	if (fd > max_fd)
-+		return -EINVAL;
-+
-+	rcu_read_lock();
-+	cur_max = files_fdtable(files)->max_fds;
-+	rcu_read_unlock();
-+
-+	/* cap to last valid index into fdtable */
-+	max_fd = max(max_fd, (cur_max - 1));
-+	while (fd <= max_fd) {
-+		struct file *file;
-+
-+		file = pick_file(files, fd++);
-+		if (!file)
-+			continue;
-+
-+		filp_close(file, files);
-+		cond_resched();
-+	}
-+
-+	return 0;
-+}
-+
- /*
-  * variant of __close_fd that gets a ref on the file for later fput
-  */
-diff --git a/fs/open.c b/fs/open.c
-index 9c7d724a6f67..c7baaee7aa47 100644
---- a/fs/open.c
-+++ b/fs/open.c
-@@ -1174,6 +1174,26 @@ SYSCALL_DEFINE1(close, unsigned int, fd)
- 	return retval;
- }
- 
-+/**
-+ * close_range() - Close all file descriptors in a given range.
-+ *
-+ * @fd:     starting file descriptor to close
-+ * @max_fd: last file descriptor to close
-+ * @flags:  reserved for future extensions
-+ *
-+ * This closes a range of file descriptors. All file descriptors
-+ * from @fd up to and including @max_fd are closed.
-+ * Currently, errors to close a given file descriptor are ignored.
-+ */
-+SYSCALL_DEFINE3(close_range, unsigned int, fd, unsigned int, max_fd,
-+		unsigned int, flags)
-+{
-+	if (flags)
-+		return -EINVAL;
-+
-+	return __close_range(current->files, fd, max_fd);
-+}
-+
- /*
-  * This routine simulates a hangup on the tty, to arrange that users
-  * are given clean terminals at login time.
-diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h
-index f07c55ea0c22..fcd07181a365 100644
---- a/include/linux/fdtable.h
-+++ b/include/linux/fdtable.h
-@@ -121,6 +121,8 @@ extern void __fd_install(struct files_struct *files,
- 		      unsigned int fd, struct file *file);
- extern int __close_fd(struct files_struct *files,
- 		      unsigned int fd);
-+extern int __close_range(struct files_struct *files, unsigned int fd,
-+			 unsigned int max_fd);
- extern int __close_fd_get_file(unsigned int fd, struct file **res);
- 
- extern struct kmem_cache *files_cachep;
-diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
-index e2870fe1be5b..c0189e223255 100644
---- a/include/linux/syscalls.h
-+++ b/include/linux/syscalls.h
-@@ -441,6 +441,8 @@ asmlinkage long sys_fchown(unsigned int fd, uid_t user, gid_t group);
- asmlinkage long sys_openat(int dfd, const char __user *filename, int flags,
- 			   umode_t mode);
- asmlinkage long sys_close(unsigned int fd);
-+asmlinkage long sys_close_range(unsigned int fd, unsigned int max_fd,
-+				unsigned int flags);
- asmlinkage long sys_vhangup(void);
- 
- /* fs/pipe.c */
-diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h
-index a87904daf103..3f36c8745d24 100644
---- a/include/uapi/asm-generic/unistd.h
-+++ b/include/uapi/asm-generic/unistd.h
-@@ -844,9 +844,11 @@ __SYSCALL(__NR_fsconfig, sys_fsconfig)
- __SYSCALL(__NR_fsmount, sys_fsmount)
- #define __NR_fspick 433
- __SYSCALL(__NR_fspick, sys_fspick)
-+#define __NR_close_range 435
-+__SYSCALL(__NR_close_range, sys_close_range)
- 
- #undef __NR_syscalls
--#define __NR_syscalls 434
-+#define __NR_syscalls 436
- 
- /*
-  * 32 bit systems traditionally used different
--- 
-2.21.0
diff --git a/a/content_digest b/N1/content_digest
index 4db77b6..a68831d 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -129,420 +129,6 @@
  "be used to implement extension. Once can imagine userspace wanting to stop\n"
  "at the first error instead of ignoring errors under certain circumstances.\n"
  "There might be other valid ideas in the future. In any case, a flag\n"
- "argument doesn't hurt and keeps us on the safe side.\n"
- "\n"
- "From an implementation side this is kept rather dumb. It saw some input\n"
- "from David and Jann but all nonsense is obviously my own!\n"
- "- Errors to close file descriptors are currently ignored. (Could be changed\n"
- "  by setting a flag in the future if needed.)\n"
- "- __close_range() is a rather simplistic wrapper around __close_fd().\n"
- "  My reasoning behind this is based on the nature of how __close_fd() needs\n"
- "  to release an fd. But maybe I misunderstood specifics:\n"
- "  We take the files_lock and rcu-dereference the fdtable of the calling\n"
- "  task, we find the entry in the fdtable, get the file and need to release\n"
- "  files_lock before calling filp_close().\n"
- "  In the meantime the fdtable might have been altered so we can't just\n"
- "  retake the spinlock and keep the old rcu-reference of the fdtable\n"
- "  around. Instead we need to grab a fresh reference to the fdtable.\n"
- "  If my reasoning is correct then there's really no point in fancyfying\n"
- "  __close_range(): We just need to rcu-dereference the fdtable of the\n"
- "  calling task once to cap the max_fd value correctly and then go on\n"
- "  calling __close_fd() in a loop.\n"
- "\n"
- "/* References */\n"
- "[1]: https://lore.kernel.org/lkml/20190516165021.GD17978@ZenIV.linux.org.uk/\n"
- "[2]: https://github.com/python/cpython/blob/9e4f2f3a6b8ee995c365e86d976937c141d867f8/Modules/_posixsubprocess.c#L220\n"
- "[3]: https://sourceware.org/bugzilla/show_bug.cgi?id=10353#c7\n"
- "[4]: https://github.com/systemd/systemd/blob/5238e9575906297608ff802a27e2ff9effa3b338/src/basic/fd-util.c#L217\n"
- "[5]: https://github.com/lxc/lxc/blob/ddf4b77e11a4d08f09b7b9cd13e593f8c047edc5/src/lxc/start.c#L236\n"
- "[6]: https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/grantpt.c;h=2030e07fa6e652aac32c775b8c6e005844c3c4eb;hb=HEAD#l17\n"
- "     Note that this is an internal implementation that is not exported.\n"
- "     Currently, libc seems to not provide an exported version of this\n"
- "     because of missing kernel support to do this.\n"
- "[7]: https://github.com/rust-lang/rust/issues/12148\n"
- "[8]: https://github.com/rust-lang/rust/blob/5f47c0613ed4eb46fca3633c1297364c09e5e451/src/libstd/sys/unix/process2.rs#L303-L308\n"
- "     Rust's solution is slightly different but is equally unperformant.\n"
- "     Rust calls getdtablesize() which is a glibc library function that\n"
- "     simply returns the current RLIMIT_NOFILE or OPEN_MAX values. Rust then\n"
- "     goes on to call close() on each fd. That's obviously overkill for most\n"
- "     tasks. Rarely, tasks - especially non-demons - hit RLIMIT_NOFILE or\n"
- "     OPEN_MAX.\n"
- "     Let's be nice and assume an unprivileged user with RLIMIT_NOFILE set\n"
- "     to 1024. Even in this case, there's a very high chance that in the\n"
- "     common case Rust is calling the close() syscall 1021 times pointlessly\n"
- "     if the task just has 0, 1, and 2 open.\n"
- "\n"
- "Suggested-by: Al Viro <viro@zeniv.linux.org.uk>\n"
- "Signed-off-by: Christian Brauner <christian@brauner.io>\n"
- "Cc: Arnd Bergmann <arnd@arndb.de>\n"
- "Cc: Jann Horn <jannh@google.com>\n"
- "Cc: David Howells <dhowells@redhat.com>\n"
- "Cc: Dmitry V. Levin <ldv@altlinux.org>\n"
- "Cc: Oleg Nesterov <oleg@redhat.com>\n"
- "Cc: Linus Torvalds <torvalds@linux-foundation.org>\n"
- "Cc: Florian Weimer <fweimer@redhat.com>\n"
- "Cc: linux-api@vger.kernel.org\n"
- "---\n"
- "v1:\n"
- "- Linus Torvalds <torvalds@linux-foundation.org>:\n"
- "  - add cond_resched() to yield cpu when closing a lot of file descriptors\n"
- "- Al Viro <viro@zeniv.linux.org.uk>:\n"
- "  - add cond_resched() to yield cpu when closing a lot of file descriptors\n"
- "v2: unchanged\n"
- "---\n"
- " arch/alpha/kernel/syscalls/syscall.tbl      |  1 +\n"
- " arch/arm/tools/syscall.tbl                  |  1 +\n"
- " arch/arm64/include/asm/unistd32.h           |  2 +\n"
- " arch/ia64/kernel/syscalls/syscall.tbl       |  1 +\n"
- " arch/m68k/kernel/syscalls/syscall.tbl       |  1 +\n"
- " arch/microblaze/kernel/syscalls/syscall.tbl |  1 +\n"
- " arch/mips/kernel/syscalls/syscall_n32.tbl   |  1 +\n"
- " arch/mips/kernel/syscalls/syscall_n64.tbl   |  1 +\n"
- " arch/mips/kernel/syscalls/syscall_o32.tbl   |  1 +\n"
- " arch/parisc/kernel/syscalls/syscall.tbl     |  1 +\n"
- " arch/powerpc/kernel/syscalls/syscall.tbl    |  1 +\n"
- " arch/s390/kernel/syscalls/syscall.tbl       |  1 +\n"
- " arch/sh/kernel/syscalls/syscall.tbl         |  1 +\n"
- " arch/sparc/kernel/syscalls/syscall.tbl      |  1 +\n"
- " arch/x86/entry/syscalls/syscall_32.tbl      |  1 +\n"
- " arch/x86/entry/syscalls/syscall_64.tbl      |  1 +\n"
- " arch/xtensa/kernel/syscalls/syscall.tbl     |  1 +\n"
- " fs/file.c                                   | 62 ++++++++++++++++++---\n"
- " fs/open.c                                   | 20 +++++++\n"
- " include/linux/fdtable.h                     |  2 +\n"
- " include/linux/syscalls.h                    |  2 +\n"
- " include/uapi/asm-generic/unistd.h           |  4 +-\n"
- " 22 files changed, 99 insertions(+), 9 deletions(-)\n"
- "\n"
- "diff --git a/arch/alpha/kernel/syscalls/syscall.tbl b/arch/alpha/kernel/syscalls/syscall.tbl\n"
- "index 9e7704e44f6d..b55d93af8096 100644\n"
- "--- a/arch/alpha/kernel/syscalls/syscall.tbl\n"
- "+++ b/arch/alpha/kernel/syscalls/syscall.tbl\n"
- "@@ -473,3 +473,4 @@\n"
- " 541\tcommon\tfsconfig\t\t\tsys_fsconfig\n"
- " 542\tcommon\tfsmount\t\t\t\tsys_fsmount\n"
- " 543\tcommon\tfspick\t\t\t\tsys_fspick\n"
- "+545\tcommon\tclose_range\t\t\tsys_close_range\n"
- "diff --git a/arch/arm/tools/syscall.tbl b/arch/arm/tools/syscall.tbl\n"
- "index aaf479a9e92d..0125c97c75dd 100644\n"
- "--- a/arch/arm/tools/syscall.tbl\n"
- "+++ b/arch/arm/tools/syscall.tbl\n"
- "@@ -447,3 +447,4 @@\n"
- " 431\tcommon\tfsconfig\t\t\tsys_fsconfig\n"
- " 432\tcommon\tfsmount\t\t\t\tsys_fsmount\n"
- " 433\tcommon\tfspick\t\t\t\tsys_fspick\n"
- "+435\tcommon\tclose_range\t\t\tsys_close_range\n"
- "diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h\n"
- "index c39e90600bb3..9a3270d29b42 100644\n"
- "--- a/arch/arm64/include/asm/unistd32.h\n"
- "+++ b/arch/arm64/include/asm/unistd32.h\n"
- "@@ -886,6 +886,8 @@ __SYSCALL(__NR_fsconfig, sys_fsconfig)\n"
- " __SYSCALL(__NR_fsmount, sys_fsmount)\n"
- " #define __NR_fspick 433\n"
- " __SYSCALL(__NR_fspick, sys_fspick)\n"
- "+#define __NR_close_range 435\n"
- "+__SYSCALL(__NR_close_range, sys_close_range)\n"
- " \n"
- " /*\n"
- "  * Please add new compat syscalls above this comment and update\n"
- "diff --git a/arch/ia64/kernel/syscalls/syscall.tbl b/arch/ia64/kernel/syscalls/syscall.tbl\n"
- "index e01df3f2f80d..1a90b464e96f 100644\n"
- "--- a/arch/ia64/kernel/syscalls/syscall.tbl\n"
- "+++ b/arch/ia64/kernel/syscalls/syscall.tbl\n"
- "@@ -354,3 +354,4 @@\n"
- " 431\tcommon\tfsconfig\t\t\tsys_fsconfig\n"
- " 432\tcommon\tfsmount\t\t\t\tsys_fsmount\n"
- " 433\tcommon\tfspick\t\t\t\tsys_fspick\n"
- "+435\tcommon\tclose_range\t\t\tsys_close_range\n"
- "diff --git a/arch/m68k/kernel/syscalls/syscall.tbl b/arch/m68k/kernel/syscalls/syscall.tbl\n"
- "index 7e3d0734b2f3..2dee2050f9ef 100644\n"
- "--- a/arch/m68k/kernel/syscalls/syscall.tbl\n"
- "+++ b/arch/m68k/kernel/syscalls/syscall.tbl\n"
- "@@ -433,3 +433,4 @@\n"
- " 431\tcommon\tfsconfig\t\t\tsys_fsconfig\n"
- " 432\tcommon\tfsmount\t\t\t\tsys_fsmount\n"
- " 433\tcommon\tfspick\t\t\t\tsys_fspick\n"
- "+435\tcommon\tclose_range\t\t\tsys_close_range\n"
- "diff --git a/arch/microblaze/kernel/syscalls/syscall.tbl b/arch/microblaze/kernel/syscalls/syscall.tbl\n"
- "index 26339e417695..923ef69e5a76 100644\n"
- "--- a/arch/microblaze/kernel/syscalls/syscall.tbl\n"
- "+++ b/arch/microblaze/kernel/syscalls/syscall.tbl\n"
- "@@ -439,3 +439,4 @@\n"
- " 431\tcommon\tfsconfig\t\t\tsys_fsconfig\n"
- " 432\tcommon\tfsmount\t\t\t\tsys_fsmount\n"
- " 433\tcommon\tfspick\t\t\t\tsys_fspick\n"
- "+435\tcommon\tclose_range\t\t\tsys_close_range\n"
- "diff --git a/arch/mips/kernel/syscalls/syscall_n32.tbl b/arch/mips/kernel/syscalls/syscall_n32.tbl\n"
- "index 0e2dd68ade57..967ed9de51cd 100644\n"
- "--- a/arch/mips/kernel/syscalls/syscall_n32.tbl\n"
- "+++ b/arch/mips/kernel/syscalls/syscall_n32.tbl\n"
- "@@ -372,3 +372,4 @@\n"
- " 431\tn32\tfsconfig\t\t\tsys_fsconfig\n"
- " 432\tn32\tfsmount\t\t\t\tsys_fsmount\n"
- " 433\tn32\tfspick\t\t\t\tsys_fspick\n"
- "+435\tn32\tclose_range\t\t\tsys_close_range\n"
- "diff --git a/arch/mips/kernel/syscalls/syscall_n64.tbl b/arch/mips/kernel/syscalls/syscall_n64.tbl\n"
- "index 5eebfa0d155c..71de731102b1 100644\n"
- "--- a/arch/mips/kernel/syscalls/syscall_n64.tbl\n"
- "+++ b/arch/mips/kernel/syscalls/syscall_n64.tbl\n"
- "@@ -348,3 +348,4 @@\n"
- " 431\tn64\tfsconfig\t\t\tsys_fsconfig\n"
- " 432\tn64\tfsmount\t\t\t\tsys_fsmount\n"
- " 433\tn64\tfspick\t\t\t\tsys_fspick\n"
- "+435\tn64\tclose_range\t\t\tsys_close_range\n"
- "diff --git a/arch/mips/kernel/syscalls/syscall_o32.tbl b/arch/mips/kernel/syscalls/syscall_o32.tbl\n"
- "index 3cc1374e02d0..5a325ab29f88 100644\n"
- "--- a/arch/mips/kernel/syscalls/syscall_o32.tbl\n"
- "+++ b/arch/mips/kernel/syscalls/syscall_o32.tbl\n"
- "@@ -421,3 +421,4 @@\n"
- " 431\to32\tfsconfig\t\t\tsys_fsconfig\n"
- " 432\to32\tfsmount\t\t\t\tsys_fsmount\n"
- " 433\to32\tfspick\t\t\t\tsys_fspick\n"
- "+435\to32\tclose_range\t\t\tsys_close_range\n"
- "diff --git a/arch/parisc/kernel/syscalls/syscall.tbl b/arch/parisc/kernel/syscalls/syscall.tbl\n"
- "index c9e377d59232..dcc0a0879139 100644\n"
- "--- a/arch/parisc/kernel/syscalls/syscall.tbl\n"
- "+++ b/arch/parisc/kernel/syscalls/syscall.tbl\n"
- "@@ -430,3 +430,4 @@\n"
- " 431\tcommon\tfsconfig\t\t\tsys_fsconfig\n"
- " 432\tcommon\tfsmount\t\t\t\tsys_fsmount\n"
- " 433\tcommon\tfspick\t\t\t\tsys_fspick\n"
- "+435\tcommon\tclose_range\t\t\tsys_close_range\n"
- "diff --git a/arch/powerpc/kernel/syscalls/syscall.tbl b/arch/powerpc/kernel/syscalls/syscall.tbl\n"
- "index 103655d84b4b..ba2c1f078cbd 100644\n"
- "--- a/arch/powerpc/kernel/syscalls/syscall.tbl\n"
- "+++ b/arch/powerpc/kernel/syscalls/syscall.tbl\n"
- "@@ -515,3 +515,4 @@\n"
- " 431\tcommon\tfsconfig\t\t\tsys_fsconfig\n"
- " 432\tcommon\tfsmount\t\t\t\tsys_fsmount\n"
- " 433\tcommon\tfspick\t\t\t\tsys_fspick\n"
- "+435\tcommon\tclose_range\t\t\tsys_close_range\n"
- "diff --git a/arch/s390/kernel/syscalls/syscall.tbl b/arch/s390/kernel/syscalls/syscall.tbl\n"
- "index e822b2964a83..d7c9043d2902 100644\n"
- "--- a/arch/s390/kernel/syscalls/syscall.tbl\n"
- "+++ b/arch/s390/kernel/syscalls/syscall.tbl\n"
- "@@ -436,3 +436,4 @@\n"
- " 431  common\tfsconfig\t\tsys_fsconfig\t\t\tsys_fsconfig\n"
- " 432  common\tfsmount\t\t\tsys_fsmount\t\t\tsys_fsmount\n"
- " 433  common\tfspick\t\t\tsys_fspick\t\t\tsys_fspick\n"
- "+435  common\tclose_range\t\tsys_close_range\t\t\tsys_close_range\n"
- "diff --git a/arch/sh/kernel/syscalls/syscall.tbl b/arch/sh/kernel/syscalls/syscall.tbl\n"
- "index 016a727d4357..9b5e6bf0ce32 100644\n"
- "--- a/arch/sh/kernel/syscalls/syscall.tbl\n"
- "+++ b/arch/sh/kernel/syscalls/syscall.tbl\n"
- "@@ -436,3 +436,4 @@\n"
- " 431\tcommon\tfsconfig\t\t\tsys_fsconfig\n"
- " 432\tcommon\tfsmount\t\t\t\tsys_fsmount\n"
- " 433\tcommon\tfspick\t\t\t\tsys_fspick\n"
- "+435\tcommon\tclose_range\t\t\tsys_close_range\n"
- "diff --git a/arch/sparc/kernel/syscalls/syscall.tbl b/arch/sparc/kernel/syscalls/syscall.tbl\n"
- "index e047480b1605..8c674a1e0072 100644\n"
- "--- a/arch/sparc/kernel/syscalls/syscall.tbl\n"
- "+++ b/arch/sparc/kernel/syscalls/syscall.tbl\n"
- "@@ -479,3 +479,4 @@\n"
- " 431\tcommon\tfsconfig\t\t\tsys_fsconfig\n"
- " 432\tcommon\tfsmount\t\t\t\tsys_fsmount\n"
- " 433\tcommon\tfspick\t\t\t\tsys_fspick\n"
- "+435\tcommon\tclose_range\t\t\tsys_close_range\n"
- "diff --git a/arch/x86/entry/syscalls/syscall_32.tbl b/arch/x86/entry/syscalls/syscall_32.tbl\n"
- "index ad968b7bac72..7f7a89a96707 100644\n"
- "--- a/arch/x86/entry/syscalls/syscall_32.tbl\n"
- "+++ b/arch/x86/entry/syscalls/syscall_32.tbl\n"
- "@@ -438,3 +438,4 @@\n"
- " 431\ti386\tfsconfig\t\tsys_fsconfig\t\t\t__ia32_sys_fsconfig\n"
- " 432\ti386\tfsmount\t\t\tsys_fsmount\t\t\t__ia32_sys_fsmount\n"
- " 433\ti386\tfspick\t\t\tsys_fspick\t\t\t__ia32_sys_fspick\n"
- "+435\ti386\tclose_range\t\tsys_close_range\t\t\t__ia32_sys_close_range\n"
- "diff --git a/arch/x86/entry/syscalls/syscall_64.tbl b/arch/x86/entry/syscalls/syscall_64.tbl\n"
- "index b4e6f9e6204a..0f7d47ae921c 100644\n"
- "--- a/arch/x86/entry/syscalls/syscall_64.tbl\n"
- "+++ b/arch/x86/entry/syscalls/syscall_64.tbl\n"
- "@@ -355,6 +355,7 @@\n"
- " 431\tcommon\tfsconfig\t\t__x64_sys_fsconfig\n"
- " 432\tcommon\tfsmount\t\t\t__x64_sys_fsmount\n"
- " 433\tcommon\tfspick\t\t\t__x64_sys_fspick\n"
- "+435\tcommon\tclose_range\t\t__x64_sys_close_range\n"
- " \n"
- " #\n"
- " # x32-specific system call numbers start at 512 to avoid cache impact\n"
- "diff --git a/arch/xtensa/kernel/syscalls/syscall.tbl b/arch/xtensa/kernel/syscalls/syscall.tbl\n"
- "index 5fa0ee1c8e00..b489532265d0 100644\n"
- "--- a/arch/xtensa/kernel/syscalls/syscall.tbl\n"
- "+++ b/arch/xtensa/kernel/syscalls/syscall.tbl\n"
- "@@ -404,3 +404,4 @@\n"
- " 431\tcommon\tfsconfig\t\t\tsys_fsconfig\n"
- " 432\tcommon\tfsmount\t\t\t\tsys_fsmount\n"
- " 433\tcommon\tfspick\t\t\t\tsys_fspick\n"
- "+435\tcommon\tclose_range\t\t\tsys_close_range\n"
- "diff --git a/fs/file.c b/fs/file.c\n"
- "index 3da91a112bab..53430d68bbd7 100644\n"
- "--- a/fs/file.c\n"
- "+++ b/fs/file.c\n"
- "@@ -10,6 +10,7 @@\n"
- " #include <linux/syscalls.h>\n"
- " #include <linux/export.h>\n"
- " #include <linux/fs.h>\n"
- "+#include <linux/kernel.h>\n"
- " #include <linux/mm.h>\n"
- " #include <linux/sched/signal.h>\n"
- " #include <linux/slab.h>\n"
- "@@ -615,12 +616,9 @@ void fd_install(unsigned int fd, struct file *file)\n"
- " \n"
- " EXPORT_SYMBOL(fd_install);\n"
- " \n"
- "-/*\n"
- "- * The same warnings as for __alloc_fd()/__fd_install() apply here...\n"
- "- */\n"
- "-int __close_fd(struct files_struct *files, unsigned fd)\n"
- "+static struct file *pick_file(struct files_struct *files, unsigned fd)\n"
- " {\n"
- "-\tstruct file *file;\n"
- "+\tstruct file *file = NULL;\n"
- " \tstruct fdtable *fdt;\n"
- " \n"
- " \tspin_lock(&files->file_lock);\n"
- "@@ -632,15 +630,63 @@ int __close_fd(struct files_struct *files, unsigned fd)\n"
- " \t\tgoto out_unlock;\n"
- " \trcu_assign_pointer(fdt->fd[fd], NULL);\n"
- " \t__put_unused_fd(files, fd);\n"
- "-\tspin_unlock(&files->file_lock);\n"
- "-\treturn filp_close(file, files);\n"
- " \n"
- " out_unlock:\n"
- " \tspin_unlock(&files->file_lock);\n"
- "-\treturn -EBADF;\n"
- "+\treturn file;\n"
- "+}\n"
- "+\n"
- "+/*\n"
- "+ * The same warnings as for __alloc_fd()/__fd_install() apply here...\n"
- "+ */\n"
- "+int __close_fd(struct files_struct *files, unsigned fd)\n"
- "+{\n"
- "+\tstruct file *file;\n"
- "+\n"
- "+\tfile = pick_file(files, fd);\n"
- "+\tif (!file)\n"
- "+\t\treturn -EBADF;\n"
- "+\n"
- "+\treturn filp_close(file, files);\n"
- " }\n"
- " EXPORT_SYMBOL(__close_fd); /* for ksys_close() */\n"
- " \n"
- "+/**\n"
- "+ * __close_range() - Close all file descriptors in a given range.\n"
- "+ *\n"
- "+ * @fd:     starting file descriptor to close\n"
- "+ * @max_fd: last file descriptor to close\n"
- "+ *\n"
- "+ * This closes a range of file descriptors. All file descriptors\n"
- "+ * from @fd up to and including @max_fd are closed.\n"
- "+ */\n"
- "+int __close_range(struct files_struct *files, unsigned fd, unsigned max_fd)\n"
- "+{\n"
- "+\tunsigned int cur_max;\n"
- "+\n"
- "+\tif (fd > max_fd)\n"
- "+\t\treturn -EINVAL;\n"
- "+\n"
- "+\trcu_read_lock();\n"
- "+\tcur_max = files_fdtable(files)->max_fds;\n"
- "+\trcu_read_unlock();\n"
- "+\n"
- "+\t/* cap to last valid index into fdtable */\n"
- "+\tmax_fd = max(max_fd, (cur_max - 1));\n"
- "+\twhile (fd <= max_fd) {\n"
- "+\t\tstruct file *file;\n"
- "+\n"
- "+\t\tfile = pick_file(files, fd++);\n"
- "+\t\tif (!file)\n"
- "+\t\t\tcontinue;\n"
- "+\n"
- "+\t\tfilp_close(file, files);\n"
- "+\t\tcond_resched();\n"
- "+\t}\n"
- "+\n"
- "+\treturn 0;\n"
- "+}\n"
- "+\n"
- " /*\n"
- "  * variant of __close_fd that gets a ref on the file for later fput\n"
- "  */\n"
- "diff --git a/fs/open.c b/fs/open.c\n"
- "index 9c7d724a6f67..c7baaee7aa47 100644\n"
- "--- a/fs/open.c\n"
- "+++ b/fs/open.c\n"
- "@@ -1174,6 +1174,26 @@ SYSCALL_DEFINE1(close, unsigned int, fd)\n"
- " \treturn retval;\n"
- " }\n"
- " \n"
- "+/**\n"
- "+ * close_range() - Close all file descriptors in a given range.\n"
- "+ *\n"
- "+ * @fd:     starting file descriptor to close\n"
- "+ * @max_fd: last file descriptor to close\n"
- "+ * @flags:  reserved for future extensions\n"
- "+ *\n"
- "+ * This closes a range of file descriptors. All file descriptors\n"
- "+ * from @fd up to and including @max_fd are closed.\n"
- "+ * Currently, errors to close a given file descriptor are ignored.\n"
- "+ */\n"
- "+SYSCALL_DEFINE3(close_range, unsigned int, fd, unsigned int, max_fd,\n"
- "+\t\tunsigned int, flags)\n"
- "+{\n"
- "+\tif (flags)\n"
- "+\t\treturn -EINVAL;\n"
- "+\n"
- "+\treturn __close_range(current->files, fd, max_fd);\n"
- "+}\n"
- "+\n"
- " /*\n"
- "  * This routine simulates a hangup on the tty, to arrange that users\n"
- "  * are given clean terminals at login time.\n"
- "diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h\n"
- "index f07c55ea0c22..fcd07181a365 100644\n"
- "--- a/include/linux/fdtable.h\n"
- "+++ b/include/linux/fdtable.h\n"
- "@@ -121,6 +121,8 @@ extern void __fd_install(struct files_struct *files,\n"
- " \t\t      unsigned int fd, struct file *file);\n"
- " extern int __close_fd(struct files_struct *files,\n"
- " \t\t      unsigned int fd);\n"
- "+extern int __close_range(struct files_struct *files, unsigned int fd,\n"
- "+\t\t\t unsigned int max_fd);\n"
- " extern int __close_fd_get_file(unsigned int fd, struct file **res);\n"
- " \n"
- " extern struct kmem_cache *files_cachep;\n"
- "diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h\n"
- "index e2870fe1be5b..c0189e223255 100644\n"
- "--- a/include/linux/syscalls.h\n"
- "+++ b/include/linux/syscalls.h\n"
- "@@ -441,6 +441,8 @@ asmlinkage long sys_fchown(unsigned int fd, uid_t user, gid_t group);\n"
- " asmlinkage long sys_openat(int dfd, const char __user *filename, int flags,\n"
- " \t\t\t   umode_t mode);\n"
- " asmlinkage long sys_close(unsigned int fd);\n"
- "+asmlinkage long sys_close_range(unsigned int fd, unsigned int max_fd,\n"
- "+\t\t\t\tunsigned int flags);\n"
- " asmlinkage long sys_vhangup(void);\n"
- " \n"
- " /* fs/pipe.c */\n"
- "diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h\n"
- "index a87904daf103..3f36c8745d24 100644\n"
- "--- a/include/uapi/asm-generic/unistd.h\n"
- "+++ b/include/uapi/asm-generic/unistd.h\n"
- "@@ -844,9 +844,11 @@ __SYSCALL(__NR_fsconfig, sys_fsconfig)\n"
- " __SYSCALL(__NR_fsmount, sys_fsmount)\n"
- " #define __NR_fspick 433\n"
- " __SYSCALL(__NR_fspick, sys_fspick)\n"
- "+#define __NR_close_range 435\n"
- "+__SYSCALL(__NR_close_range, sys_close_range)\n"
- " \n"
- " #undef __NR_syscalls\n"
- "-#define __NR_syscalls 434\n"
- "+#define __NR_syscalls 436\n"
- " \n"
- " /*\n"
- "  * 32 bit systems traditionally used different\n"
- "-- \n"
- 2.21.0
+ argument doesn't hurt and keeps us on the safe side.
 
-f51984b74c20a1e1b85250ecab1177daa64ec7b1a5d4b5ee62e74a62a2a0c738
+67bd4b696af6d5a6b22c8ca27862eea040d6abb78277d672c875476365cee1b3

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox