Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 22844 invoked from network); 17 Jul 2006 18:53:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Jul 2006 18:53:17 -0000 Received: (qmail 77806 invoked by uid 500); 17 Jul 2006 18:53:17 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 77753 invoked by uid 500); 17 Jul 2006 18:53:17 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 77732 invoked by uid 99); 17 Jul 2006 18:53:17 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Jul 2006 11:53:17 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [208.30.140.160] (HELO moroha.quovadx.com) (208.30.140.160) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Jul 2006 11:53:15 -0700 Received: from qxvcexch01.ad.quovadx.com (qxvcexch01.ad.quovadx.com [192.168.170.59]) by moroha.quovadx.com (8.13.6/8.13.4) with ESMTP id k6HIqfLW017729 for ; Mon, 17 Jul 2006 18:52:41 GMT Received: from [10.70.3.113] ([10.70.3.113]) by qxvcexch01.ad.quovadx.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 17 Jul 2006 12:52:55 -0600 Message-ID: <44BBDCA2.3080509@roguewave.com> Date: Mon, 17 Jul 2006 12:53:22 -0600 From: Martin Sebor Organization: Rogue Wave Software User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050920 X-Accept-Language: en-us, en MIME-Version: 1.0 To: stdcxx-dev@incubator.apache.org Subject: Re: Environment for the test of the string functions memory overrun with example References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 17 Jul 2006 18:52:55.0591 (UTC) FILETIME=[36E60B70:01C6A9D2] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Farid Zaripov wrote: > [...] > Windows grant read access with write and execute access rights except > PAGE_NOACCESS. > SuSe Linux grant read access with execute access. > I think Solaris 9 grant read access only when PROT_READ is specified > explicitly. I see. > > http://www.opengroup.org/onlinepubs/009695399/functions/mmap.html says > that guaranteed only: > - no write access if PROT_WRITE is not specified; > - no any access if prot == PROT_NONE. [...] > I see two ways to resolve these asserts: > > 1) add #elif defined (__linux__) guarded code (see below) > > bool canread = (tcase.prot_ & > #if defined (_WIN32) || defined (_WIN64) > (RW_PROT_READ | RW_PROT_WRITE | RW_PROT_EXEC)) > #elif defined (__linux__) > (RW_PROT_READ | RW_PROT_EXEC)) > #else > (RW_PROT_READ) > #endif > && ( > (protbelow && 0 <= tcase.index_) > || (!protbelow && tcase.index_ < int (tcase.size_)) > ); > > 2) remove check of read access if RW_PROT_READ is not specified > explicitly Going by what POSIX says and avoiding any assumptions beyond it sounds like the way to go to me. In addition, since PROT_EXEC isn't really being tested I'm wondering if we should remove it. Can you think of any way to use it for anything? Martin