Commit Graph

8 Commits

Author SHA1 Message Date
Enji Cooper
374d7f62e0 Revert r313565 -- :mmap__bad_arguments passes again after r313655
PR:		216976
Sponsored by:	Dell EMC Isilon
2017-02-11 20:31:57 +00:00
Enji Cooper
28e5919804 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
2017-02-10 19:31:09 +00:00
Enji Cooper
5fea45956e 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
2017-01-14 04:09:01 +00:00
Enji Cooper
410757a4f4 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
2016-04-19 22:25:14 +00:00
John Baldwin
9695459d02 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
2015-09-04 01:02:21 +00:00
John Baldwin
7f43ee0fb7 Add various tests to ensure that invalid arguments passed to mmap()
trigger failures.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D3269
2015-08-06 16:14:29 +00:00
John Baldwin
95eee0d40b 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
2015-08-06 16:12:12 +00:00
Enji Cooper
42484f6f69 Move tests/sys/kern/mmap_test to tests/sys/vm/mmap_test
As jhb noted, the actual mmap(2) implementation is under sys/vm, not
sys/kern/, so the correct logical place is tests/sys/vm/, not
tests/sys/kern/

X-MFC with: r282076
MFC after: 6 days
2015-04-27 17:53:09 +00:00