From patchwork Fri Apr 11 23:04:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 338646 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 587CA140085 for ; Sat, 12 Apr 2014 09:05:02 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:references:mime-version:content-type :content-transfer-encoding:in-reply-to; q=dns; s=default; b=Fk1p BFcZP8LO1f16/3s4HyLfupI2odLJMfWqYzccZJozvWuVSi2GAolJb+fIlDtaJZxM TfhG5+wcOgxBu7p1L2lf+1dX5fkCJU3a005bNNuTkGh9xdhmo3FjaVcNxPclI9B9 KYFQ4rvQI2LmaKCnhhA6lF5IFs+cWMUOB7tIgB0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:references:mime-version:content-type :content-transfer-encoding:in-reply-to; s=default; bh=+yHMioVGd6 6Q4lDIPzOwoe1OEkc=; b=T8m99nd2aIK3HGtxomzPNHRfEjiHnIUWwHY9bh95o6 edmB+0xgwp+lUd8UiwKn67DBzJeVYY4p6R/k0Deq8JvUqa+9P6tAPMDtBrLpec8n L3v2Jo0tUCjGymFBAq/g9tAzhLm85agJBrbWJUiCVLyLrLeMDvDthWj7zQggDxNT I= Received: (qmail 8828 invoked by alias); 11 Apr 2014 23:04:55 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 8817 invoked by uid 89); 11 Apr 2014 23:04:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: toccata.ens-lyon.org Received: from toccata.ens-lyon.fr (HELO toccata.ens-lyon.org) (140.77.166.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 11 Apr 2014 23:04:54 +0000 Received: from localhost (localhost [127.0.0.1]) by toccata.ens-lyon.org (Postfix) with ESMTP id 429DB840A4; Sat, 12 Apr 2014 01:04:51 +0200 (CEST) Received: from toccata.ens-lyon.org ([127.0.0.1]) by localhost (toccata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lPLYXKeYf4H8; Sat, 12 Apr 2014 01:04:51 +0200 (CEST) Received: from type.ipv6 (244.208.24.109.rev.sfr.net [109.24.208.244]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by toccata.ens-lyon.org (Postfix) with ESMTPSA id 0D431840A2; Sat, 12 Apr 2014 01:04:51 +0200 (CEST) Received: from samy by type.ipv6 with local (Exim 4.82) (envelope-from ) id 1WYkV7-0007qz-Rq; Sat, 12 Apr 2014 01:04:49 +0200 Date: Sat, 12 Apr 2014 01:04:49 +0200 From: Samuel Thibault To: Thomas Schwinge , svante.signell@gmail.com, Ian Lance Taylor , gcc-patches@gcc.gnu.org, bug-hurd@gnu.org, fotis.koutoulakis@gmail.com, Roland McGrath Subject: Re: GCC's -fsplit-stack disturbing Mach's vm_allocate Message-ID: <20140411230449.GB7323@type.home.polyno.me> Mail-Followup-To: Thomas Schwinge , svante.signell@gmail.com, Ian Lance Taylor , gcc-patches@gcc.gnu.org, bug-hurd@gnu.org, fotis.koutoulakis@gmail.com, Roland McGrath References: <8761x7nkks.fsf@kepler.schwinge.homeip.net> <20130621231655.24D002C14C@topped-with-meat.com> <87r4fumx2g.fsf@kepler.schwinge.homeip.net> <87ip10o90k.fsf@kepler.schwinge.homeip.net> <20140404191416.GG5350@type> <1397027146.1276.29.camel@G3620.my.own.domain> <87fvln6jjp.fsf@schwinge.name> <20140411215144.GX7323@type.home.polyno.me> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140411215144.GX7323@type.home.polyno.me> User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) Samuel Thibault, le Fri 11 Apr 2014 23:51:44 +0200, a écrit : > So, do we really want to let munmap poke a hole at address 0 and thus > let further vm_map() return address 0? i.e. we could apply this: Samuel diff --git a/sysdeps/mach/munmap.c b/sysdeps/mach/munmap.c index 57d99f9..a46e3f1 100644 --- a/sysdeps/mach/munmap.c +++ b/sysdeps/mach/munmap.c @@ -27,6 +27,11 @@ int __munmap (__ptr_t addr, size_t len) { kern_return_t err; + if (addr == 0) + { + errno = EINVAL; + return -1; + } if (err = __vm_deallocate (__mach_task_self (), (vm_address_t) addr, (vm_size_t) len)) {