Date: Sat, 11 Feb 2017 20:27:40 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313655 - head/sys/vm Message-ID: <201702112027.v1BKRe7Z054574@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Sat Feb 11 20:27:39 2017 New Revision: 313655 URL: https://svnweb.freebsd.org/changeset/base/313655 Log: Change type of the prot parameter for kern_vm_mmap() from vm_prot_t to int. This makes the code to pass whole word of the mmap(2) syscall argument prot to the syscall helper kern_vm_mmap(), which can validate all bits. The change provides temporal fix for sys/vm/mmap_test mmap__bad_arguments, which was broken after r313352. PR: 216976 Reported and tested by: ngie Sponsored by: The FreeBSD Foundation Modified: head/sys/vm/vm_extern.h head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_extern.h ============================================================================== --- head/sys/vm/vm_extern.h Sat Feb 11 20:27:06 2017 (r313654) +++ head/sys/vm/vm_extern.h Sat Feb 11 20:27:39 2017 (r313655) @@ -72,7 +72,7 @@ void kmem_init_zero_region(void); void kmeminit(void); int kern_vm_mmap(struct thread *td, vm_offset_t addr, vm_size_t size, - vm_prot_t prot, int flags, int fd, off_t pos); + int prot, int flags, int fd, off_t pos); int kern_vm_mprotect(struct thread *td, vm_offset_t addr, vm_size_t size, vm_prot_t prot); int kern_vm_msync(struct thread *td, vm_offset_t addr, vm_size_t size, Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Sat Feb 11 20:27:06 2017 (r313654) +++ head/sys/vm/vm_mmap.c Sat Feb 11 20:27:39 2017 (r313655) @@ -196,7 +196,7 @@ sys_mmap(struct thread *td, struct mmap_ int kern_vm_mmap(struct thread *td, vm_offset_t addr, vm_size_t size, - vm_prot_t prot, int flags, int fd, off_t pos) + int prot, int flags, int fd, off_t pos) { struct file *fp; vm_size_t pageoff;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201702112027.v1BKRe7Z054574>