Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/uvm Fix user-triggerable kernel crash as reported in PR ...



details:   https://anonhg.NetBSD.org/src/rev/7c166214669a
branches:  trunk
changeset: 826822:7c166214669a
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Sun Oct 01 01:45:02 2017 +0000

description:
Fix user-triggerable kernel crash as reported in PR kern/52573 (from
Bruno Haible).

XXX Pull-up to netbsd-8

diffstat:

 sys/uvm/uvm_map.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 84c5841a73cb -r 7c166214669a sys/uvm/uvm_map.c
--- a/sys/uvm/uvm_map.c Sat Sep 30 21:47:12 2017 +0000
+++ b/sys/uvm/uvm_map.c Sun Oct 01 01:45:02 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_map.c,v 1.351 2017/05/30 17:09:17 chs Exp $        */
+/*     $NetBSD: uvm_map.c,v 1.352 2017/10/01 01:45:02 pgoyette Exp $   */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.351 2017/05/30 17:09:17 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.352 2017/10/01 01:45:02 pgoyette Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pax.h"
@@ -4991,7 +4991,7 @@
                vme = kmem_alloc(vmesize, KM_SLEEP);
        for (entry = map->header.next; entry != &map->header;
            entry = entry->next) {
-               if (oldp && (dp - (char *)oldp) < *oldlenp) {
+               if (oldp && (dp - (char *)oldp) < vmesize) {
                        error = fill_vmentry(l, p, &vme[count], map, entry);
                        if (error)
                                goto out;
@@ -5009,7 +5009,7 @@
                const u_int esize = min(sizeof(*vme), elem_size);
                dp = oldp;
                for (size_t i = 0; i < count; i++) {
-                       if (oldp && (dp - (char *)oldp) < *oldlenp) {
+                       if (oldp && (dp - (char *)oldp) < vmesize) {
                                error = sysctl_copyout(l, &vme[i], dp, esize);
                                if (error)
                                        break;



Home | Main Index | Thread Index | Old Index