freebsd-dev/sys/kern
Kyle Evans b5a7ac997f kern_shm_open: push O_CLOEXEC into caller control
The motivation for this change is to allow wrappers around shm to be written
that don't set CLOEXEC. kern_shm_open currently accepts O_CLOEXEC but sets
it unconditionally. kern_shm_open is used by the shm_open(2) syscall, which
is mandated by POSIX to set CLOEXEC, and CloudABI's sys_fd_create1().
Presumably O_CLOEXEC is intended in the latter caller, but it's unclear from
the context.

sys_shm_open() now unconditionally sets O_CLOEXEC to meet POSIX
requirements, and a comment has been dropped in to kern_fd_open() to explain
the situation and add a pointer to where O_CLOEXEC setting is maintained for
shm_open(2) correctness. CloudABI's sys_fd_create1() also unconditionally
sets O_CLOEXEC to match previous behavior.

This also has the side-effect of making flags correctly reflect the
O_CLOEXEC status on this fd for the rest of kern_shm_open(), but a
glance-over leads me to believe that it didn't really matter.

Reviewed by:	kib, markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D21119
2019-07-31 15:16:51 +00:00
..
bus_if.m Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
capabilities.conf Enable copy_file_range(2) in capability mode. 2019-07-30 15:59:44 +00:00
clock_if.m
cpufreq_if.m
device_if.m
genassym.sh
genoffset.c
genoffset.sh
imgact_aout.c Switch to use shared vnode locks for text files during image activation. 2019-05-05 11:20:43 +00:00
imgact_binmisc.c
imgact_elf32.c
imgact_elf64.c
imgact_elf.c Remove a redundant offset computation in elf_load_section(). 2019-07-24 15:18:05 +00:00
imgact_shell.c
init_main.c Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
init_sysent.c Regenerate after r350447. 2019-07-30 16:01:16 +00:00
kern_acct.c
kern_alq.c
kern_clock.c Update td_runtime of running thread on each statclock(). 2019-06-14 01:09:10 +00:00
kern_clocksource.c
kern_condvar.c
kern_conf.c
kern_cons.c
kern_context.c
kern_cpu.c
kern_cpuset.c
kern_ctf.c kern/CTF: link_elf_ctf_get() on big endian platforms 2019-05-27 04:20:31 +00:00
kern_descrip.c Check and avoid overflow when incrementing fp->f_count in 2019-07-21 15:07:12 +00:00
kern_dtrace.c
kern_dump.c
kern_environment.c Fix zapping of static hints and env in init_static_kenv(). Environments 2019-02-05 15:34:55 +00:00
kern_et.c
kern_event.c Avoid relying on header pollution from sys/refcount.h. 2019-07-29 20:26:01 +00:00
kern_exec.c Merge the vm_page hold and wire mechanisms. 2019-07-08 19:46:20 +00:00
kern_exit.c proc: make clear_orphan an public API 2019-07-29 21:42:57 +00:00
kern_fail.c
kern_ffclock.c
kern_fork.c Inherit P2_PROTMAX_{ENABLE,DISABLE} across fork(). 2019-07-10 19:57:48 +00:00
kern_hhook.c
kern_idle.c
kern_intr.c Disable intr_storm_threshold mechanism by default 2019-05-24 22:33:14 +00:00
kern_jail.c
kern_kcov.c kcov depends on eventhandler.h. 2019-05-20 19:14:07 +00:00
kern_khelp.c
kern_kthread.c
kern_ktr.c Drop "All rights reserved" from my copyright statements. 2019-03-06 22:11:45 +00:00
kern_ktrace.c
kern_linker.c
kern_lock.c
kern_lockf.c
kern_lockstat.c
kern_loginclass.c
kern_malloc.c
kern_mbuf.c Invoke ext_free function when freeing an unmapped mbuf. 2019-07-02 22:58:21 +00:00
kern_mib.c Add missing include of sys/boot.h 2019-06-24 20:52:21 +00:00
kern_module.c
kern_mtxpool.c
kern_mutex.c
kern_ntptime.c
kern_osd.c
kern_physio.c
kern_pmc.c
kern_poll.c
kern_priv.c
kern_proc.c Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
kern_procctl.c Control implicit PROT_MAX() using procctl(2) and the FreeBSD note 2019-07-02 19:07:17 +00:00
kern_prot.c Remove wrong inline keyword. 2019-05-30 16:11:20 +00:00
kern_racct.c
kern_rangelock.c Add non-blocking trylock variants for the rangelock functions. 2019-06-27 23:10:40 +00:00
kern_rctl.c
kern_resource.c Fix a typo introduced in r344133 2019-03-18 12:41:42 +00:00
kern_rmlock.c
kern_rwlock.c Drop "All rights reserved" from my copyright statements. 2019-03-06 22:11:45 +00:00
kern_sdt.c
kern_sema.c
kern_sendfile.c Centralize the logic in vfs_vmio_unwire() and sendfile_free_page(). 2019-07-29 22:01:28 +00:00
kern_sharedpage.c
kern_shutdown.c EKCD: Add Chacha20 encryption mode 2019-05-23 20:12:24 +00:00
kern_sig.c Avoid relying on header pollution from sys/refcount.h. 2019-07-29 20:26:01 +00:00
kern_switch.c
kern_sx.c
kern_synch.c Add wakeup_any(), cheaper wakeup_one() for taskqueue(9). 2019-06-20 01:15:33 +00:00
kern_syscalls.c
kern_sysctl.c Make the warning intervals for deprecated crypto algorithms tunable. 2019-06-11 23:00:55 +00:00
kern_tc.c
kern_thr.c
kern_thread.c Always set td_errno to the error value of a system call. 2019-07-15 21:16:01 +00:00
kern_time.c Disallow excessively small times of day in clock_settime(2). 2019-05-03 21:26:44 +00:00
kern_timeout.c Save the last callout function executed on each CPU 2019-07-03 19:22:44 +00:00
kern_tslog.c
kern_ubsan.c Teach the kernel KUBSAN runtime about alignment_assumption 2019-05-28 09:12:15 +00:00
kern_umtx.c In do_sem2_wait(), balance umtx_key_get() with umtx_key_release() on retry. 2019-07-15 19:18:25 +00:00
kern_uuid.c Use sbuf_cat() in GEOM confxml generation. 2019-06-19 15:36:02 +00:00
kern_xxx.c
ksched.c
link_elf_obj.c Remove dead check. 2019-06-03 15:23:37 +00:00
link_elf.c Fix dpcpu and vnet panics with complex types at the end of the section. 2019-06-08 17:44:42 +00:00
linker_if.m
Make.tags.inc Remove a couple of harmless stray references to nandfs. 2019-06-25 16:39:25 +00:00
Makefile
makesyscalls.sh makesyscalls.sh: always use absolute path for syscalls.conf 2019-05-30 20:56:23 +00:00
md4c.c
md5c.c
msi_if.m
p1003_1b.c
pic_if.m
posix4_mib.c
sched_4bsd.c Reduce umtx-related work on exec and exit 2019-05-08 16:30:38 +00:00
sched_ule.c Reduce umtx-related work on exec and exit 2019-05-08 16:30:38 +00:00
serdev_if.m
stack_protector.c Revert r346292 (permit_nonrandom_stackcookies) 2019-05-13 23:37:44 +00:00
subr_acl_nfs4.c
subr_acl_posix1e.c
subr_autoconf.c
subr_blist.c Address problems in blist_alloc introduced in r349777. The swap block allocator could become corrupted 2019-07-11 20:52:39 +00:00
subr_boot.c When parsing command line stuff, treat tabs and spaces the same. 2019-04-18 22:52:12 +00:00
subr_bufring.c
subr_bus_dma.c Add an external mbuf buffer type that holds multiple unmapped pages. 2019-06-29 00:48:33 +00:00
subr_bus.c Fix description of debug.obsolete_panic. 2019-07-02 22:57:24 +00:00
subr_busdma_bufalloc.c
subr_capability.c
subr_clock.c Kill tz_minuteswest and tz_dsttime. 2019-03-12 04:49:47 +00:00
subr_compressor.c Separate kernel crc32() implementation to its own header (gsb_crc32.h) and 2019-06-17 19:49:08 +00:00
subr_counter.c
subr_coverage.c Extract the coverage sanitizer KPI to a new file. 2019-01-29 11:04:17 +00:00
subr_devmap.c
subr_devstat.c
subr_disk.c Fix botched merge with 355066 2019-03-12 05:10:41 +00:00
subr_dummy_vdso_tc.c
subr_early.c
subr_epoch.c Fix the turnstile_lock() KPI. 2019-07-24 23:04:59 +00:00
subr_eventhandler.c Include ktr.h in more compilation units 2019-05-21 20:38:48 +00:00
subr_fattime.c
subr_firmware.c
subr_gtaskqueue.c Make taskqgroup_attach{,_cpu}(9) work across architectures 2019-02-12 21:23:59 +00:00
subr_hash.c
subr_hints.c
subr_intr.c Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
subr_kdb.c
subr_kobj.c Prevent some kobj memory allocation failures from panicking the system. 2019-01-31 22:27:39 +00:00
subr_lock.c Drop "All rights reserved" from my copyright statements. 2019-03-06 22:11:45 +00:00
subr_log.c
subr_mchain.c
subr_module.c
subr_msgbuf.c
subr_param.c The older detection methods (smbios.bios.vendor and smbios.system.product) 2019-05-21 13:29:53 +00:00
subr_pcpu.c
subr_pctrie.c kern/subr_pctrie: Fix mismatched signedness in assertion comparison 2019-04-06 21:56:24 +00:00
subr_pidctrl.c
subr_power.c Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
subr_prf.c device_printf: Use sbuf for more coherent prints on SMP 2019-05-07 17:47:20 +00:00
subr_prof.c
subr_rangeset.c Implement rangesets. 2019-02-20 09:38:19 +00:00
subr_rman.c
subr_rtc.c
subr_sbuf.c Fix typo in r349178. 2019-06-19 13:30:50 +00:00
subr_scanf.c
subr_sfbuf.c
subr_sglist.c Add an external mbuf buffer type that holds multiple unmapped pages. 2019-06-29 00:48:33 +00:00
subr_sleepqueue.c Add wakeup_any(), cheaper wakeup_one() for taskqueue(9). 2019-06-20 01:15:33 +00:00
subr_smp.c x86: Implement MWAIT support for stopping a CPU 2019-05-04 20:34:26 +00:00
subr_stack.c stack(9): Drop unused API mode and comment that referenced it 2019-03-15 22:39:55 +00:00
subr_syscall.c Don't pass error from syscallenter() to syscallret(). 2019-07-15 21:25:16 +00:00
subr_taskqueue.c Add wakeup_any(), cheaper wakeup_one() for taskqueue(9). 2019-06-20 01:15:33 +00:00
subr_terminal.c
subr_trap.c
subr_turnstile.c Fix the turnstile_lock() KPI. 2019-07-24 23:04:59 +00:00
subr_uio.c
subr_unit.c
subr_vmem.c Update the DIAGNOSTIC-only vmem_check_sanity() after r347949. 2019-05-18 14:19:23 +00:00
subr_witness.c Enable witness(4) blessings. 2019-07-30 17:09:58 +00:00
sys_capability.c
sys_generic.c Check and avoid overflow when incrementing fp->f_count in 2019-07-21 15:07:12 +00:00
sys_getrandom.c
sys_pipe.c Fix mutual exclusion in pipe_direct_write(). 2019-06-29 16:05:52 +00:00
sys_procdesc.c
sys_process.c Avoid relying on header pollution from sys/refcount.h. 2019-07-29 20:26:01 +00:00
sys_socket.c
syscalls.c Update the generated syscall files for copy_file_range(2) added by 2019-07-25 05:55:55 +00:00
syscalls.master Add kernel support for a Linux compatible copy_file_range(2) syscall. 2019-07-25 05:46:16 +00:00
systrace_args.c Update the generated syscall files for copy_file_range(2) added by 2019-07-25 05:55:55 +00:00
sysv_ipc.c sysv: get rid of fork/exit hooks if the code is compiled in 2019-05-04 19:05:30 +00:00
sysv_msg.c
sysv_sem.c
sysv_shm.c sysv: get rid of fork/exit hooks if the code is compiled in 2019-05-04 19:05:30 +00:00
tty_compat.c
tty_info.c
tty_inq.c
tty_outq.c
tty_pts.c
tty_tty.c Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
tty_ttydisc.c
tty.c Defer funsetown() calls for a TTY to tty_rel_free(). 2019-07-04 15:42:02 +00:00
uipc_accf.c
uipc_debug.c
uipc_domain.c
uipc_mbuf2.c
uipc_mbuf.c Add an external mbuf buffer type that holds multiple unmapped pages. 2019-06-29 00:48:33 +00:00
uipc_mbufhash.c
uipc_mqueue.c mqueuefs: fix struct file leak 2019-07-23 20:59:36 +00:00
uipc_sem.c
uipc_shm.c kern_shm_open: push O_CLOEXEC into caller control 2019-07-31 15:16:51 +00:00
uipc_sockbuf.c Compress pending socket buffer data once it is marked ready. 2019-06-29 00:50:25 +00:00
uipc_socket.c Improve the input validation for l_linger. 2019-07-14 21:44:18 +00:00
uipc_syscalls.c Avoid leaking fp references when truncating SCM_RIGHTS control messages. 2019-02-05 17:55:08 +00:00
uipc_usrreq.c Check and avoid overflow when incrementing fp->f_count in 2019-07-21 15:07:12 +00:00
vfs_acl.c
vfs_aio.c
vfs_bio.c Centralize the logic in vfs_vmio_unwire() and sendfile_free_page(). 2019-07-29 22:01:28 +00:00
vfs_cache.c [skip ci] Fix the comment for cache_purge(9) 2019-07-22 21:03:52 +00:00
vfs_cluster.c
vfs_default.c Add kernel support for a Linux compatible copy_file_range(2) syscall. 2019-07-25 05:46:16 +00:00
vfs_export.c
vfs_extattr.c extattr_list_vp: Narrow locked section somewhat 2019-02-05 04:47:21 +00:00
vfs_hash.c
vfs_init.c
vfs_lookup.c NDFREE(): Fix unlocking for LOCKPARENT|LOCKLEAF and ndp->ni_dvp == ndp->ni_vp. 2019-05-21 15:12:13 +00:00
vfs_mount.c Include ktr.h in more compilation units 2019-05-21 20:38:48 +00:00
vfs_mountroot.c Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
vfs_subr.c Better comments for vlrureclaim 2019-07-28 16:07:27 +00:00
vfs_syscalls.c Add kernel support for a Linux compatible copy_file_range(2) syscall. 2019-07-25 05:46:16 +00:00
vfs_vnops.c Add kernel support for a Linux compatible copy_file_range(2) syscall. 2019-07-25 05:46:16 +00:00
vnode_if.src Add kernel support for a Linux compatible copy_file_range(2) syscall. 2019-07-25 05:46:16 +00:00