History log of /freebsd/tests/sys/vm/mmap_test.c (Results 1 – 25 of 26)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 33c2c58f 04-Oct-2024 Mark Johnston <markj@FreeBSD.org>

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 i

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: c7841c6b8e41 ("Relax restrictions on private mappings of POSIX shm objects.")
Differential Revision: https://reviews.freebsd.org/D46741

show more ...


Revision tags: release/13.4.0, release/14.1.0, release/13.3.0, release/14.0.0
# b3e76948 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


Revision tags: release/13.2.0, release/12.4.0, release/13.1.0
# 766c2466 18-Feb-2022 Arka Sharma <arka_sharma@dell.com>

mmap map_at_zero test: handle W^X

Use 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 the
test matrix, but I would

mmap map_at_zero test: handle W^X

Use 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 the
test matrix, but I would argue that a separate test should be written,
since that's orthogonal to map_at_zero.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

show more ...


Revision tags: release/12.3.0, release/13.0.0, release/12.2.0
# f56a08c8 13-Oct-2020 Andrew Turner <andrew@FreeBSD.org>

Fix write only mappings on arm64

When trapping on a wrote access to a buffer the kernel has mapped as write
only we should only pass the VM_PROT_WRITE flag. Previously the call to
vm_fault_trap as t

Fix write only mappings on arm64

When trapping on a wrote access to a buffer the kernel has mapped as write
only we should only pass the VM_PROT_WRITE flag. Previously the call to
vm_fault_trap as the VM_PROT_READ flag was unexpected.

Reported by: manu
Sponsored by: Innovate UK

show more ...


Revision tags: release/11.4.0, release/12.1.0, release/11.3.0, release/12.0.0, release/11.2.0, release/10.4.0, release/11.1.0
# a3906ca5 17-Feb-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r313644 through r313895.


# 374d7f62 11-Feb-2017 Enji Cooper <ngie@FreeBSD.org>

Revert r313565 -- :mmap__bad_arguments passes again after r313655

PR: 216976
Sponsored by: Dell EMC Isilon


# 1a36faad 11-Feb-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r313301 through r313643.


# 28e59198 10-Feb-2017 Enji Cooper <ngie@FreeBSD.org>

Expect :mmap__bad_arguments to fail

Some recent changes to vm related to mmap(2) have broken the prot checks that
would result with an EINVAL with this case

I suspect r313352 is the root-cause the

Expect :mmap__bad_arguments to fail

Some recent changes to vm related to mmap(2) have broken the prot checks that
would result with an EINVAL with this case

I suspect r313352 is the root-cause the issue

PR: 216976
Sponsored by: Dell EMC Isilon

show more ...


# d370fd1c 14-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r311940 through r312200.


# 5fea4595 14-Jan-2017 Enji Cooper <ngie@FreeBSD.org>

Fix -Wsign-compare warnings

The loop index (i) doesn't need to be size_t as its comparison is signed

MFC after: 1 week
Sponsored by: Dell EMC Isilon


Revision tags: release/11.0.1, release/11.0.0
# 410757a4 20-Apr-2016 Enji Cooper <ngie@FreeBSD.org>

Fix leaks and test for getpagesize() returning == -1

- close file descriptors after use.
- Always munmap memory regions after mmap'ing them.
- Make sure getpagesize() returns a value greater than 0

Fix leaks and test for getpagesize() returning == -1

- close file descriptors after use.
- Always munmap memory regions after mmap'ing them.
- Make sure getpagesize() returns a value greater than 0 and use a
cached value instead of always calling getpagesize(3).

CID: 1331374-1331377, 1331653-1331662
Differential Revision: https://reviews.freebsd.org/D6011
MFC after: 2 weeks
Reported by: Coverity
Reviewed by: cem
Sponsored by: EMC / Isilon Storage Division

show more ...


Revision tags: release/10.3.0
# 11d38a57 28-Oct-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head

Sponsored by: Gandi.net


# becbad1f 13-Oct-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head


# b5ff185e 12-Sep-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head


# 00176600 09-Sep-2015 Navdeep Parhar <np@FreeBSD.org>

Merge r286744-r287584 from head.


# d9442b10 05-Sep-2015 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r286858 through r287489.


# 9695459d 04-Sep-2015 John Baldwin <jhb@FreeBSD.org>

Add more mmap tests related to character devices.
- Add cdev-related tests for bad args.
- Add two simple tests cases for mapping /dev/zero that test for
MAP_ANON-like behavior.

Reviewed by: alc,

Add more mmap tests related to character devices.
- Add cdev-related tests for bad args.
- Add two simple tests cases for mapping /dev/zero that test for
MAP_ANON-like behavior.

Reviewed by: alc, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D3323

show more ...


# ab875b71 14-Aug-2015 Navdeep Parhar <np@FreeBSD.org>

Catch up with head, primarily for the 1.14.4.0 firmware.


Revision tags: release/10.2.0
# 1347814c 07-Aug-2015 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r285924 through r286421.


# 7f43ee0f 06-Aug-2015 John Baldwin <jhb@FreeBSD.org>

Add various tests to ensure that invalid arguments passed to mmap()
trigger failures.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D3269


# 95eee0d4 06-Aug-2015 John Baldwin <jhb@FreeBSD.org>

Convert the map_at_zero test case to ATF. In particular, this will
facilitate adding more mmap() tests.

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D3268


# 416ba5c7 22-Jun-2015 Navdeep Parhar <np@FreeBSD.org>

Catch up with HEAD (r280229-r284686).


# 98e0ffae 27-May-2015 Simon J. Gerraty <sjg@FreeBSD.org>

Merge sync of head


# 7757a1b4 03-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Merge from head


# de7df74b 01-May-2015 Glen Barber <gjb@FreeBSD.org>

MFH: r281855-r282312

Sponsored by: The FreeBSD Foundation


12