From owner-svn-src-all@freebsd.org Sat Feb 11 20:27:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49AE8CDB17C; Sat, 11 Feb 2017 20:27:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1999419D9; Sat, 11 Feb 2017 20:27:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1BKReHe054576; Sat, 11 Feb 2017 20:27:40 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1BKRe7Z054574; Sat, 11 Feb 2017 20:27:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702112027.v1BKRe7Z054574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 11 Feb 2017 20:27:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313655 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2017 20:27:41 -0000 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;