From owner-freebsd-bugs Sun May 14 12: 0: 8 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 6408737B60D for ; Sun, 14 May 2000 12:00:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id MAA46564; Sun, 14 May 2000 12:00:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Date: Sun, 14 May 2000 12:00:01 -0700 (PDT) Message-Id: <200005141900.MAA46564@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Matthew Dillon Subject: Re: i386/18095: critical VM mmap/madvise bug Reply-To: Matthew Dillon Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR i386/18095; it has been noted by GNATS. From: Matthew Dillon To: pha@pdq.com Cc: FreeBSD-gnats-submit@freebsd.org Subject: Re: i386/18095: critical VM mmap/madvise bug Date: Sun, 14 May 2000 11:41:34 -0700 (PDT) Paul, try this patch to /usr/src/sys/vm/vm_map.c and tell me if it works. It appears to work for me when I test using your test program. -Matt Matthew Dillon Index: vm_map.c =================================================================== RCS file: /home/ncvs/src/sys/vm/vm_map.c,v retrieving revision 1.187 diff -u -r1.187 vm_map.c --- vm_map.c 2000/02/28 04:10:35 1.187 +++ vm_map.c 2000/05/14 18:31:06 @@ -1127,15 +1127,19 @@ (current != &map->header) && (current->start < end); current = current->next ) { + vm_offset_t useStart; + if (current->eflags & MAP_ENTRY_IS_SUB_MAP) continue; pindex = OFF_TO_IDX(current->offset); count = atop(current->end - current->start); + useStart = current->start; if (current->start < start) { pindex += atop(start - current->start); count -= atop(start - current->start); + useStart = start; } if (current->end > end) count -= atop(current->end - end); @@ -1148,7 +1152,7 @@ if (behav == MADV_WILLNEED) { pmap_object_init_pt( map->pmap, - current->start, + useStart, current->object.vm_object, pindex, (count << PAGE_SHIFT), To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message