Module Name: src Committed By: martin Date: Wed Aug 21 14:32:11 UTC 2019
Modified Files: src/sys/uvm [netbsd-8]: uvm_aobj.c Log Message: Pull up following revision(s) (requested by msaitoh in ticket #1342): sys/uvm/uvm_aobj.c: revision 1.128 Avoid undefined behavior in uao_pagein_page(). Found by kUBSan. OK'd by riastradh. I think this is a real bug on amd64 at least. To generate a diff of this commit: cvs rdiff -u -r1.125.2.1 -r1.125.2.2 src/sys/uvm/uvm_aobj.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/uvm/uvm_aobj.c diff -u src/sys/uvm/uvm_aobj.c:1.125.2.1 src/sys/uvm/uvm_aobj.c:1.125.2.2 --- src/sys/uvm/uvm_aobj.c:1.125.2.1 Thu Nov 2 21:29:53 2017 +++ src/sys/uvm/uvm_aobj.c Wed Aug 21 14:32:11 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_aobj.c,v 1.125.2.1 2017/11/02 21:29:53 snj Exp $ */ +/* $NetBSD: uvm_aobj.c,v 1.125.2.2 2019/08/21 14:32:11 martin Exp $ */ /* * Copyright (c) 1998 Chuck Silvers, Charles D. Cranor and @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uvm_aobj.c,v 1.125.2.1 2017/11/02 21:29:53 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_aobj.c,v 1.125.2.2 2019/08/21 14:32:11 martin Exp $"); #ifdef _KERNEL_OPT #include "opt_uvmhist.h" @@ -1340,7 +1340,7 @@ uao_pagein_page(struct uvm_aobj *aobj, i npages = 1; KASSERT(mutex_owned(uobj->vmobjlock)); - rv = uao_get(uobj, pageidx << PAGE_SHIFT, &pg, &npages, + rv = uao_get(uobj, (voff_t)pageidx << PAGE_SHIFT, &pg, &npages, 0, VM_PROT_READ | VM_PROT_WRITE, 0, PGO_SYNCIO); /*