1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-29 08:08:37 +00:00
freebsd/tests/sys
Mark Johnston 33c2c58f0a shm: Respect PROT_MAX when creating private mappings
We were previously unconditionally adding PROT_WRITE to the maxprot of
private mapping (because a private mapping can be written even if the
fd is read-only), but this might violate the user's PROT_MAX request.

While here, rename cap_maxprot to max_maxprot.  This is the intersection
of the maximum protections imposed by capsicum rights on the fd (not
really relevant for private mappings) and the user-required maximum
protections (which were not being obeyed).  In particular, cap_maxprot
is a misnomer after the introduction of PROT_MAX.

Add some regression test cases.  mmap__maxprot_shm fails without this
patch.

Note: Capsicum's CAP_MMAP_W is a bit ambiguous.  Should it be required
in order to create writeable private mappings?  Currently it is, even
though such mappings don't permit writes to the object referenced by the
fd.

Reported by:	brooks
Reviewed by:	brooks
MFC after:	1 month
Fixes:		c7841c6b8e ("Relax restrictions on private mappings of POSIX shm objects.")
Differential Revision:	https://reviews.freebsd.org/D46741
2024-10-04 15:56:34 +00:00
..
acl Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
aio Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
audit Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
auditpipe Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
cam ctl: skip the test if ctladm is missing (WITHOUT_ISCSI) 2024-10-01 15:59:47 +02:00
capsicum capsicum tests: Serialize functional tests 2024-09-04 14:28:28 +00:00
cddl zfsd: replace vdevs with the AUX faulted state 2024-10-03 16:21:46 -06:00
common vnet tests: verify that we can load if_epair and if_bridge 2024-07-23 15:57:25 +02:00
compat32 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
devrandom Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
fifo Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
file Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
fs fusefs: fix an uninitialized memory access in fuse_vnop_deallocate 2024-09-08 15:50:40 -06:00
geom ggate tests: Use unique ports among tests 2024-09-04 14:28:28 +00:00
kern unix tests: Skip random_eor_and_waitall unconditionally 2024-09-25 07:44:14 -04:00
kqueue Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
mac Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
mqueue Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
net if_ovpn tests: destroy an if_ovpn interface before it's been used 2024-09-10 20:34:23 +02:00
netgraph Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
netinet netinet tests: Make some tests more reliable when run in parallel 2024-09-09 15:28:24 +00:00
netinet6 netinet tests: Make some tests more reliable when run in parallel 2024-09-09 15:28:24 +00:00
netipsec Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
netlink Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
netmap Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
netpfil pf: fix double ruleset evaluation for fragments sent to dummynet 2024-10-03 13:49:57 +02:00
opencrypto Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
pjdfstest Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
posixshm shm: Respect PROT_MAX when creating private mappings 2024-10-04 15:56:34 +00:00
ses
sound sound tests: Add SNDSTIOC_ADD_USER_DEVS test 2024-08-24 15:07:29 +03:00
sys tests: Add buf_ring overflow checks 2024-09-30 12:04:24 +00:00
vfs Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
vm shm: Respect PROT_MAX when creating private mappings 2024-10-04 15:56:34 +00:00
vmm
Makefile ctl: add some ATF tests for READ BUFFER 2024-09-04 14:38:12 +00:00
Makefile.depend
Makefile.inc Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00