mmap_test: determine page size at run time rather than compile timeSponsored by: NetflixReviewed by: impDifferential Revision: https://reviews.freebsd.org/D52735
tests: move some files to the tests packagesome test support libraries had escaped confinement and were foundwandering around the utilities package: /usr/tests/lib/csu/dynamiclib/libh_csu.so /u
tests: move some files to the tests packagesome test support libraries had escaped confinement and were foundwandering around the utilities package: /usr/tests/lib/csu/dynamiclib/libh_csu.so /usr/tests/lib/libthr/dlopen/h_pthread_dlopen.so /usr/tests/lib/libthr/dlopen/h_pthread_dlopen.so.1 /usr/tests/sys/vm/stack/libsoxstack.sothese aren't built using bsd.test.mk, so they don't get the defaultPACKAGE=tests option; set this by hand in their Makefiles to put themback where they belong.Reviewed by: manu, des, emasteApproved by: des (mentor)Differential Revision: https://reviews.freebsd.org/D50147
show more ...
shm: Respect PROT_MAX when creating private mappingsWe were previously unconditionally adding PROT_WRITE to the maxprot ofprivate mapping (because a private mapping can be written even if thefd i
shm: Respect PROT_MAX when creating private mappingsWe were previously unconditionally adding PROT_WRITE to the maxprot ofprivate mapping (because a private mapping can be written even if thefd is read-only), but this might violate the user's PROT_MAX request.While here, rename cap_maxprot to max_maxprot. This is the intersectionof the maximum protections imposed by capsicum rights on the fd (notreally relevant for private mappings) and the user-required maximumprotections (which were not being obeyed). In particular, cap_maxprotis a misnomer after the introduction of PROT_MAX.Add some regression test cases. mmap__maxprot_shm fails without thispatch.Note: Capsicum's CAP_MMAP_W is a bit ambiguous. Should it be requiredin order to create writeable private mappings? Currently it is, eventhough such mappings don't permit writes to the object referenced by thefd.Reported by: brooksReviewed by: brooksMFC after: 1 monthFixes: c7841c6b8e41 ("Relax restrictions on private mappings of POSIX shm objects.")Differential Revision: https://reviews.freebsd.org/D46741
Remove residual blank line at start of MakefileThis is a residual of the $FreeBSD$ removal.MFC After: 3 days (though I'll just run the command on the branches)Sponsored by: Netflix
soxstack: slience 32-bit gcc warningModern GCC complains when casting pointers to integers of a differentsize (even a larger one). Switch from uint64_t to uintptr_t which willalways be the right
soxstack: slience 32-bit gcc warningModern GCC complains when casting pointers to integers of a differentsize (even a larger one). Switch from uint64_t to uintptr_t which willalways be the right size for a stack address instead of maybe being toobig.Reviewed by: dchagin, emasteDifferential Revision: https://reviews.freebsd.org/D45087
mlock tests: Add a regression testThe test tries to trigger creation of a superpage mapping in anmlock()ed region.MFC after: 2 weeks
tests: Handle SIGSEGV in the vm stack mprotect exec testTo exit gracefully handle SIGSEGV and mark the test as failed.MFC after: 3 days
Remove $FreeBSD$: one-line sh patternRemove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
Remove $FreeBSD$: one-line .c patternRemove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
Remove $FreeBSD$: two-line .h patternRemove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
vm: Allow MAP_32BIT for all architecturesReviewed by: alc, kib, markjDifferential revision: https://reviews.freebsd.org/D41435
tests: Also exclude powerpc/powerpcspe from mmap_map_32bit_testSponsored by: The FreeBSD Foundation
soxstack: silence GCC warningAdd parens around _STACK_FLAG_GROWS expression to fix GCC warning aboutarithmetic in operand of '|'.Sponsored by: The FreeBSD Foundation
tests: Fix build after 8920c5f2MFC after: 2 weeks
tests: Add stack grows testsReviewed by: kibDifferential Revision: https://reviews.freebsd.org/D41320MFC after: 2 weeks
tests: Add MAP_32BIT flag testReviewed by: kib, markjDifferential Revision: https://reviews.freebsd.org/D41236MFC after: 1 month
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDThe SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catchup to that fact and revert to their recommended match of
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDThe SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catchup to that fact and revert to their recommended match of BSD-2-Clause.Discussed with: pfgMFC After: 3 daysSponsored by: Netflix
shared_shadow_inval_test: fix copy-pasto in error messageMFC after: 1 weekSponsored by: Dell EMC Isilon
tests: Handle platforms with MAXPAGESIZES < 2Reported by: JenkinsFixes: 1dfa8b73f6a6 ("tests: Add more shared shadow regression tests")
Fix shared_shadow_inval_test when superpages are disabledIn that case, there is only one page size.Reviewed by: kibMFC after: 1 weekSponsored by: Dell EMC IsilonDifferential Revision: https://
Fix shared_shadow_inval_test when superpages are disabledIn that case, there is only one page size.Reviewed by: kibMFC after: 1 weekSponsored by: Dell EMC IsilonDifferential Revision: https://reviews.freebsd.org/D36265
tests: Add more shared shadow regression testsThe new tests exercise simulated COW that occurs when the protections ona wired, copy-on-write mapping are changed from read-only to read-write.MFC
tests: Add more shared shadow regression testsThe new tests exercise simulated COW that occurs when the protections ona wired, copy-on-write mapping are changed from read-only to read-write.MFC after: 2 weeksSponsored by: The FreeBSD FoundationDifferential Revision: https://reviews.freebsd.org/D35636
mmap map_at_zero test: handle W^XUse kern.elfXX.allow_wx to decide whether to map W+X or W-only memory.Future work could expand this test to add an "allow_wx" axis to thetest matrix, but I would
mmap map_at_zero test: handle W^XUse kern.elfXX.allow_wx to decide whether to map W+X or W-only memory.Future work could expand this test to add an "allow_wx" axis to thetest matrix, but I would argue that a separate test should be written,since that's orthogonal to map_at_zero.MFC after: 1 weekSponsored by: Dell EMC Isilon
shared shadow vm object invalidation regression testAdd a regression test for a scenario where a shadow vm object is sharedby multiple mappings. If a page COW occurs through one of the mappings,
shared shadow vm object invalidation regression testAdd a regression test for a scenario where a shadow vm object is sharedby multiple mappings. If a page COW occurs through one of the mappings,then the virtual-to-physical mapping may become invalidated.This tests the scenario from CVE-2021-29626 which was fixed by982693bb729badac4e65ecd59772979f2849a2b2.Reviewed by: markjSponsored by: Dell EMC Isilon
[tests] Fix unused variable warning in gccReviewed by: markj, imp, cem,Approved by: markjDifferential Revision: https://reviews.freebsd.org/D26792
Fix write only mappings on arm64When trapping on a wrote access to a buffer the kernel has mapped as writeonly we should only pass the VM_PROT_WRITE flag. Previously the call tovm_fault_trap as t
Fix write only mappings on arm64When trapping on a wrote access to a buffer the kernel has mapped as writeonly we should only pass the VM_PROT_WRITE flag. Previously the call tovm_fault_trap as the VM_PROT_READ flag was unexpected.Reported by: manuSponsored by: Innovate UK
12