From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116069 invoked by alias); 5 Oct 2016 11:49:46 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 116045 invoked by uid 89); 5 Oct 2016 11:49:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.5 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Wielaard, wielaard X-HELO: mx1.redhat.com Subject: Re: fortification and valgrind/memcheck (Was: [PATCH BZ#20422] Do not allow asan/msan/tsan and fortify@the same time) To: Mark Wielaard References: <20160929100429.GQ7282@tucnak.redhat.com> <20160929104408.GR7282@tucnak.redhat.com> <87fuofp4sq.fsf@mid.deneb.enyo.de> <20161002093953.GS7282@tucnak.redhat.com> <8760pbnl1m.fsf@mid.deneb.enyo.de> <20161004064623.GG7282@tucnak.redhat.com> <1475583338.21750.26.camel@redhat.com> From: Florian Weimer Cc: libc-alpha@sourceware.org Message-ID: Date: Wed, 05 Oct 2016 11:49: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: <1475583338.21750.26.camel@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2016-10/txt/msg00083.txt.bz2 On 10/04/2016 02:15 PM, Mark Wielaard wrote: > My proposal was to extend __chk_fail (or introduce a new __chk_fail_addr > function) that provides the address that would have been accessed. Then > valgrind just intercepts __chk_fail and uses that address to provide > some additional information. There many different reasons why __chk_fail might be called. For example, you get a fortify failure if you call snprintf with a buffer size that is larger than what is inferred by the compiler. This happens even if the actual written value fits within the shorter space. So you have a fortify failure without any invalid memory accesses. Florian