alistair23-linux/arch/sparc/kernel
Linus Torvalds 4f30a60aa7 close-range-v5.9
-----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQRAhzRXHqcMeLMyaSiRxhvAZXjcogUCXygcpgAKCRCRxhvAZXjc
 ogPeAQDv1ncqtNroFAC4pJ4tQhH7JSjW0OltiMk/AocY/J2SdQD9GJ15luYJ0/om
 697q/Z68sndRynhdoZlMuf3oYuBlHQw=
 =3ZhE
 -----END PGP SIGNATURE-----

Merge tag 'close-range-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux

Pull close_range() implementation from Christian Brauner:
 "This adds the close_range() syscall. It allows to efficiently close a
  range of file descriptors up to all file descriptors of a calling
  task.

  This is coordinated with the FreeBSD folks which have copied our
  version of this syscall and in the meantime have already merged it in
  April 2019:

    https://reviews.freebsd.org/D21627
    https://svnweb.freebsd.org/base?view=revision&revision=359836

  The syscall originally came up in a discussion around the new mount
  API and making new file descriptor types cloexec by default. During
  this discussion, Al suggested the close_range() syscall.

  First, it helps to close all file descriptors of an exec()ing task.
  This can be done safely via (quoting Al's example from [1] verbatim):

        /* that exec is sensitive */
        unshare(CLONE_FILES);
        /* we don't want anything past stderr here */
        close_range(3, ~0U);
        execve(....);

  The code snippet above is one way of working around the problem that
  file descriptors are not cloexec by default. This is aggravated by the
  fact that we can't just switch them over without massively regressing
  userspace. For a whole class of programs having an in-kernel method of
  closing all file descriptors is very helpful (e.g. demons, service
  managers, programming language standard libraries, container managers
  etc.).

  Second, it allows userspace to avoid implementing closing all file
  descriptors by parsing through /proc/<pid>/fd/* and calling close() on
  each file descriptor and other hacks. From looking at various
  large(ish) userspace code bases this or similar patterns are very
  common in service managers, container runtimes, and programming
  language runtimes/standard libraries such as Python or Rust.

  In addition, the syscall will also work for tasks that do not have
  procfs mounted and on kernels that do not have procfs support compiled
  in. In such situations the only way to make sure that all file
  descriptors are closed is to call close() on each file descriptor up
  to UINT_MAX or RLIMIT_NOFILE, OPEN_MAX trickery.

  Based on Linus' suggestion close_range() also comes with a new flag
  CLOSE_RANGE_UNSHARE to more elegantly handle file descriptor dropping
  right before exec. This would usually be expressed in the sequence:

        unshare(CLONE_FILES);
        close_range(3, ~0U);

  as pointed out by Linus it might be desirable to have this be a part
  of close_range() itself under a new flag CLOSE_RANGE_UNSHARE which
  gets especially handy when we're closing all file descriptors above a
  certain threshold.

  Test-suite as always included"

* tag 'close-range-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux:
  tests: add CLOSE_RANGE_UNSHARE tests
  close_range: add CLOSE_RANGE_UNSHARE
  tests: add close_range() tests
  arch: wire-up close_range()
  open: add close_range()
2020-08-04 15:12:02 -07:00
..
syscalls arch: wire-up close_range() 2020-06-17 00:07:38 +02:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
adi_64.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 482 2019-06-19 17:09:52 +02:00
apc.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
asm-offsets.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
audit.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
auxio_32.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
auxio_64.c sparc: Use of_node_name_eq for node name comparisons 2018-11-18 13:35:21 -08:00
btext.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
central.c sparc: Use of_node_name_eq for node name comparisons 2018-11-18 13:35:21 -08:00
cherrs.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
chmc.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
compat_audit.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cpu.c mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
cpumap.c sparc64: Replace zero-length array with flexible-array 2020-05-07 18:49:04 -07:00
cpumap.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
devices.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ds.c sparc64: Replace zero-length array with flexible-array 2020-05-07 18:49:04 -07:00
dtlb_miss.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dtlb_prot.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ebus.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
entry.h sparc64: Add support for ADI register fields, ASIs and traps 2018-03-18 07:38:45 -07:00
entry.S sparc: share process creation helpers between sparc and sparc64 2020-06-23 10:49:56 +02:00
etrap_32.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
etrap_64.S sparc64: Add support for ADI (Application Data Integrity) 2018-03-18 07:38:48 -07:00
fpu_traps.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ftrace.c sparc/function_graph: Simplify with function_graph_enter() 2018-11-27 20:31:46 -05:00
getsetcc.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
head_32.S sparc32: mm: Restructure sparc32 MMU page-table layout 2020-05-13 15:32:00 -07:00
head_64.S mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
helpers.S treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
hvapi.c sparc64: Oracle DAX infrastructure 2018-01-22 08:17:15 -08:00
hvcalls.S sparc64: Oracle DAX infrastructure 2018-01-22 08:17:15 -08:00
hvtramp.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
idprom.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
iommu-common.c iommu-common: move to arch/sparc 2018-05-09 06:54:27 +02:00
iommu.c sparc64/iommu: allow large DMA masks 2019-02-20 07:28:58 -07:00
iommu_common.h sparc: remove the mapping_error dma_map_ops method 2018-12-06 06:56:40 -08:00
ioport.c sparc32: use per-device dma_ops 2020-04-02 18:11:55 -07:00
irq.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
irq_32.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
irq_64.c sparc: Use of_node_name_eq for node name comparisons 2018-11-18 13:35:21 -08:00
itlb_miss.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ivec.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
jump_label.c jump_label: move 'asm goto' support test to Kconfig 2019-01-06 09:46:51 +09:00
kernel.h sparc: share process creation helpers between sparc and sparc64 2020-06-23 10:49:56 +02:00
kgdb_32.c kgdb/treewide: constify struct kgdb_arch arch_kgdb_ops 2018-12-30 08:33:06 +00:00
kgdb_64.c kgdb/treewide: constify struct kgdb_arch arch_kgdb_ops 2018-12-30 08:33:06 +00:00
kprobes.c bpf/error-inject/kprobes: Clear current_kprobe and enable preempt in kprobe 2018-06-21 12:33:19 +02:00
kstack.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ktlb.S mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
ldc.c iommu-common: move to arch/sparc 2018-05-09 06:54:27 +02:00
led.c proc: convert everything to "struct proc_ops" 2020-02-04 03:05:26 +00:00
leon_kernel.c sparc: Remove unused leon_trans_init 2018-11-18 13:35:22 -08:00
leon_pci.c sparc/PCI: Use dev_printk() when possible 2018-05-22 07:54:06 -05:00
leon_pci_grpci1.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
leon_pci_grpci2.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
leon_pmc.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
leon_smp.c mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
Makefile sparc: share process creation helpers between sparc and sparc64 2020-06-23 10:49:56 +02:00
mdesc.c mdesc: fix a missing-check bug in get_vdev_port_node_info() 2019-06-02 22:15:35 -07:00
misctrap.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
module.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nmi.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
of_device_32.c sparc: Use DT node full_name instead of name for resources 2018-11-18 13:35:22 -08:00
of_device_64.c sparc: Use DT node full_name instead of name for resources 2018-11-18 13:35:22 -08:00
of_device_common.c sparc32: use per-device dma_ops 2020-04-02 18:11:55 -07:00
of_device_common.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pci.c mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
pci_common.c sparc/PCI: Use dev_printk() when possible 2018-05-22 07:54:06 -05:00
pci_fire.c mm: replace all open encodings for NUMA_NO_NODE 2019-03-05 21:07:14 -08:00
pci_impl.h sparc/PCI: Support arbitrary host bridge address offset 2018-02-15 15:07:30 -06:00
pci_msi.c sparc/PCI: Use dev_printk() when possible 2018-05-22 07:54:06 -05:00
pci_psycho.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pci_sabre.c sparc: Use of_node_name_eq for node name comparisons 2018-11-18 13:35:21 -08:00
pci_schizo.c mm: replace all open encodings for NUMA_NO_NODE 2019-03-05 21:07:14 -08:00
pci_sun4v.c sparc64/pci_sun4v: fix ATU checks for large DMA masks 2019-04-10 21:42:04 +02:00
pci_sun4v.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pci_sun4v_asm.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pcic.c sparc/PCI: Use dev_printk() when possible 2018-05-22 07:54:06 -05:00
pcr.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
perf_event.c sparc: perf: fix updated event period in response to PERF_EVENT_IOC_PERIOD 2019-06-02 22:16:33 -07:00
pmc.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
power.c sparc: Convert to using %pOFn instead of device_node.name 2018-11-18 13:35:20 -08:00
process.c arch: rename copy_thread_tls() back to copy_thread() 2020-07-04 23:41:37 +02:00
process_32.c arch: rename copy_thread_tls() back to copy_thread() 2020-07-04 23:41:37 +02:00
process_64.c arch: rename copy_thread_tls() back to copy_thread() 2020-07-04 23:41:37 +02:00
prom.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
prom_32.c sparc32, leon: Stop adding vendor and device id to prom ambapp path components 2020-01-21 13:24:35 +01:00
prom_64.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
prom_common.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
prom_irqtrans.c sparc: Use device_type helpers to access the node type 2018-11-18 13:35:21 -08:00
psycho_common.c mm: replace all open encodings for NUMA_NO_NODE 2019-03-05 21:07:14 -08:00
psycho_common.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ptrace_32.c mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
ptrace_64.c mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
reboot.c sparc: Use device_type helpers to access the node type 2018-11-18 13:35:21 -08:00
rtrap_32.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rtrap_64.S sched/rt, sparc: Use CONFIG_PREEMPTION 2019-12-08 14:37:35 +01:00
sbus.c mm: replace all open encodings for NUMA_NO_NODE 2019-03-05 21:07:14 -08:00
setup_32.c mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
setup_64.c mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
signal32.c mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
signal_32.c mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
signal_64.c mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
sigutil.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sigutil_32.c Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
sigutil_64.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
smp_32.c mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
smp_64.c mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
sparc_ksyms.c sparc: move exports to definitions 2016-08-07 23:55:43 -04:00
spiterrs.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sstate.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
stacktrace.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
starfire.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sun4d_irq.c sparc: Use of_node_name_eq for node name comparisons 2018-11-18 13:35:21 -08:00
sun4d_smp.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sun4m_irq.c mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
sun4m_smp.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sun4v_ivec.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sun4v_mcd.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 482 2019-06-19 17:09:52 +02:00
sun4v_tlb_miss.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sys32.S sparc: get rid of remaining SIGN... wrappers 2018-03-20 12:01:23 -04:00
sys_sparc32.c sparc: remove unused header file nfs_fs.h 2020-06-02 18:41:48 -07:00
sys_sparc_32.c signal: Remove the task parameter from force_sig_fault 2019-05-29 09:31:43 -05:00
sys_sparc_64.c sparc64: fix adjtimex regression 2020-02-02 11:54:41 +01:00
syscalls.S sparc64: enable HAVE_COPY_THREAD_TLS 2020-06-23 10:49:54 +02:00
sysfs.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
systbls.h sparc: get rid of asm wrapper for nis_syscall() 2018-03-20 12:05:17 -04:00
systbls_32.S sparc: generate uapi header and system call table files 2018-11-18 18:52:22 -08:00
systbls_64.S sparc: generate uapi header and system call table files 2018-11-18 18:52:22 -08:00
time_32.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
time_64.c cpufreq: Call transition notifier only once for each policy 2019-05-10 12:20:36 +02:00
trampoline_32.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trampoline_64.S mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
traps_32.c mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
traps_64.c mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
tsb.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ttable_32.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ttable_64.S sparc64: Add support for ADI register fields, ASIs and traps 2018-03-18 07:38:45 -07:00
una_asm_32.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
una_asm_64.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
unaligned_32.c Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
unaligned_64.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
uprobes.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
urtt_fill.S sparc64: Add support for ADI (Application Data Integrity) 2018-03-18 07:38:48 -07:00
utrap.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vdso.c vDSO for sparc 2017-11-15 14:21:03 +09:00
vio.c sparc: use scnprintf() in show_pciobppath_attr() in vio.c 2020-05-13 15:35:58 -07:00
viohs.c sparc64: viohs: Remove VLA usage 2018-10-07 22:42:00 -07:00
visemul.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vmlinux.lds.S Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc 2020-01-30 07:36:43 -08:00
windows.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
winfixup.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
wof.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
wuf.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00