From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53454 invoked by alias); 16 Nov 2016 15:58:48 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 53401 invoked by uid 89); 16 Nov 2016 15:58:48 -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,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1898, HTo:D*fu-berlin.de, consideration, Attached X-HELO: mail-qk0-f196.google.com Received: from mail-qk0-f196.google.com (HELO mail-qk0-f196.google.com) (209.85.220.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 16 Nov 2016 15:58:37 +0000 Received: by mail-qk0-f196.google.com with SMTP id x190so21838550qkb.0 for ; Wed, 16 Nov 2016 07:58:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=FsY37q15rAABf5xO/67Sykeu2DLOOs9ZAj3AQJZVHLo=; b=JeyhBo4vnnHgy8q5ZdjaQefx7/lhgzVFbmN5Fyjtx/b93r8zkPNmwXCTIszTuqrH8v IWO5aVdyu3iLT278+B7EnqtjFDdbXAx8RsuwiGKDsf/FFmXZnHvxSCkzksDjNxCjGptF pyv/yGfeJaMw1hK6bmcS573zvbHBwFvkKsDupxqtJCC7L7cD/1XFzAkBDf7pvDfJS2G6 EQZBwC7gXFB7aulSrHL5mPMlvXvezDauj9VDaDtEoVC21igMp5NF5NBmsjaZdFW5IJ8j cVAPhqdZVS0SDaW8wIq87KvPlKvcaX0xgZg3s5vTcrj3FbwkJG4vuqPtk7gzIX9djk7u WFvg== X-Gm-Message-State: AKaTC01e5WQ4OJiXIkpf9bZmZ+nvXkY1GssgnDfkb37Eeq249qC50Rw6gTExhvM5x586mQ== X-Received: by 10.233.221.135 with SMTP id r129mr3941268qkf.56.1479311916094; Wed, 16 Nov 2016 07:58:36 -0800 (PST) Received: from [192.168.0.26] (75-166-206-79.hlrn.qwest.net. [75.166.206.79]) by smtp.gmail.com with ESMTPSA id b94sm18075643qkb.16.2016.11.16.07.58.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Nov 2016 07:58:35 -0800 (PST) Subject: Re: [PING 2] [PATCH] enhance buffer overflow warnings (and c/53562) To: Jakub Jelinek , Jeff Law , gcc-patches@gcc.gnu.org, Tobias Burnus References: <20161031123909.GA9233@physik.fu-berlin.de> <334666bc-6308-aa5f-f63f-40697695152f@gmail.com> <904d9d3b-8662-e714-cc82-e08c72c54c0e@gmail.com> <20161101141025.GR3541@tucnak.redhat.com> <20161101191420.GZ3541@tucnak.redhat.com> <6acf4a8f-1451-d58a-900c-833f6dc2e21a@gmail.com> <20161102073759.GG3541@tucnak.redhat.com> <4745f128-62a1-ead9-cdf8-f26b18f8051a@gmail.com> <20161102193230.GZ3541@tucnak.redhat.com> <852bbe4d-3fa5-7a42-a51d-0b73bc745ffc@gmail.com> From: Martin Sebor Message-ID: Date: Wed, 16 Nov 2016 15:58:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-11/txt/msg01647.txt.bz2 I'm still looking for a review of the patch below, first posted on 10/28 and last updated/pinged last Wednesday: https://gcc.gnu.org/ml/gcc-patches/2016-11/msg00896.html Thanks On 11/09/2016 03:49 PM, Martin Sebor wrote: > The attached minor update to the patch also resolves bug 77784 that > points out that -Wformat-length issues a warning also issued during > the expansion of some of the __builtin___sprintf_chk intrinsics. > > Martin > > On 11/04/2016 02:16 PM, Martin Sebor wrote: >> Attached is an update to the patch that takes into consideration >> the feedback I got. It goes back to adding just one option, >> -Wstringop-overflow, as in the original, while keeping the Object >> Size type as an argument. It uses type-1 as the default setting >> for string functions (strcpy et al.) and, unconditionally, type-0 >> for raw memory functions (memcpy, etc.) >> >> I retested Binutils 2.27 and the Linux kernel again with this patch >> and also added Glibc, and it doesn't complain about anything (both >> Binutils and the kernel also build cleanly with an unpatched GCC >> with_FORTIFY_SOURCE=2 or its rough equivalent for the kernel). >> The emit-rtl.c warning (bug 78174) has also been suppressed by >> the change to bos type-0 for memcpy. >> >> While the patch doesn't trigger any false positives (AFAIK) it is >> subject to a fair number of false negatives due to the limitations >> of the tree-object-size pass, and due to transformations done by >> other passes that prevent it from detecting some otherwise obvious >> overflows. Although unfortunate, I believe the warnings that are >> emitted are useful as the first line of defense in software that >> doesn't use _FORTIFY_SOURCE (such as GCC itself). And this can >> of course be improved if some of the limitations are removed over >> time. >> >> Martin >