From owner-freebsd-bugs@FreeBSD.ORG Sun Dec 9 16:10:01 2007 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA9D016A421 for ; Sun, 9 Dec 2007 16:10:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 8F8F813C4E3 for ; Sun, 9 Dec 2007 16:10:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id lB9GA1jE092577 for ; Sun, 9 Dec 2007 16:10:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id lB9GA1g6092576; Sun, 9 Dec 2007 16:10:01 GMT (envelope-from gnats) Resent-Date: Sun, 9 Dec 2007 16:10:01 GMT Resent-Message-Id: <200712091610.lB9GA1g6092576@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Tijl Coosemans Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6C7616A418 for ; Sun, 9 Dec 2007 16:04:45 +0000 (UTC) (envelope-from tijl@kalimero.kotnet.org) Received: from thumbler.kulnet.kuleuven.ac.be (thumbler.kulnet.kuleuven.ac.be [134.58.240.45]) by mx1.freebsd.org (Postfix) with ESMTP id 9352113C44B for ; Sun, 9 Dec 2007 16:04:45 +0000 (UTC) (envelope-from tijl@kalimero.kotnet.org) Received: from localhost (localhost [127.0.0.1]) by thumbler.kulnet.kuleuven.ac.be (Postfix) with ESMTP id 1FDC3138608 for ; Sun, 9 Dec 2007 16:38:17 +0100 (CET) Received: from smtps02.kuleuven.be (smtpshost02.kulnet.kuleuven.be [134.58.240.75]) by thumbler.kulnet.kuleuven.ac.be (Postfix) with ESMTP id 78DB1138601 for ; Sun, 9 Dec 2007 16:38:15 +0100 (CET) Received: from kalimero.kotnet.org (kalimero.kotnet.org [10.4.16.222]) by smtps02.kuleuven.be (Postfix) with ESMTP id 3A472F3863 for ; Sun, 9 Dec 2007 16:38:15 +0100 (CET) Received: from kalimero.kotnet.org (kalimero.kotnet.org [127.0.0.1]) by kalimero.kotnet.org (8.14.2/8.14.1) with ESMTP id lB9FcEhr002413 for ; Sun, 9 Dec 2007 16:38:15 +0100 (CET) (envelope-from tijl@kalimero.kotnet.org) Received: (from tijl@localhost) by kalimero.kotnet.org (8.14.2/8.14.1/Submit) id lB9FcEjk002412; Sun, 9 Dec 2007 16:38:14 +0100 (CET) (envelope-from tijl) Message-Id: <200712091538.lB9FcEjk002412@kalimero.kotnet.org> Date: Sun, 9 Dec 2007 16:38:14 +0100 (CET) From: Tijl Coosemans To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: kern/118510: munmap(2) doesn't remove all mappings X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Tijl Coosemans List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2007 16:10:01 -0000 >Number: 118510 >Category: kern >Synopsis: munmap(2) doesn't remove all mappings >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Dec 09 16:10:00 UTC 2007 >Closed-Date: >Last-Modified: >Originator: Tijl Coosemans >Release: FreeBSD 7.0-BETA3 i386 >Organization: >Environment: System: FreeBSD kalimero.kotnet.org 7.0-BETA3 FreeBSD 7.0-BETA3 #1: Sat Nov 17 19:01:40 CET 2007 >Description: When a memory region has been partially munmap()ed, subsequent calls to munmap() on this region have no effect. >How-To-Repeat: The following program should segfault, but doesn't. It mmap()s 2 pages and munmap()s them again but the second page is still accessible. --- test.c begins here --- #include #include #include int main( int argc, char **argv ) { unsigned int const page_size = getpagesize(); void *map; char volatile *cmap; map = mmap( NULL, 2 * page_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0 ); munmap( map, page_size ); munmap( map, 2 * page_size ); cmap = map; cmap[ page_size ] = 'a'; printf( "%c\n", cmap[ page_size ] ); return 0; } --- test.c ends here --- >Fix: >Release-Note: >Audit-Trail: >Unformatted: