From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19847 invoked by alias); 23 Oct 2014 10:00:34 -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 19833 invoked by uid 89); 23 Oct 2014 10:00:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 23 Oct 2014 10:00:33 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9NA0TDT025516 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 23 Oct 2014 06:00:30 -0400 Received: from tucnak.zalov.cz (ovpn-116-116.ams2.redhat.com [10.36.116.116]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9NA0R7L012725 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Thu, 23 Oct 2014 06:00:29 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.14.9/8.14.9) with ESMTP id s9NA0P3n017527; Thu, 23 Oct 2014 12:00:26 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.14.9/8.14.9/Submit) id s9NA0Pmm017525; Thu, 23 Oct 2014 12:00:25 +0200 Date: Thu, 23 Oct 2014 10:07:00 -0000 From: Jakub Jelinek To: Andrey Ryabinin Cc: Yury Gribov , GCC Patches , Konstantin Serebryany , Dmitry Vyukov , Konstantin Khlebnikov Subject: Re: [PATCHv4] Enable -fsanitize-recover for KASan Message-ID: <20141023100025.GE10376@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <54095E23.6050900@samsung.com> <5416B3A2.4050200@samsung.com> <54299507.7090800@samsung.com> <5448AA21.9080601@samsung.com> <20141023071353.GY10376@tucnak.redhat.com> <5448AE0D.2080207@samsung.com> <5448CF90.2040001@samsung.com> <20141023095532.GD10376@tucnak.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141023095532.GD10376@tucnak.redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg02353.txt.bz2 On Thu, Oct 23, 2014 at 11:55:32AM +0200, Jakub Jelinek wrote: > On Thu, Oct 23, 2014 at 01:51:12PM +0400, Andrey Ryabinin wrote: > > IMO we don't need different versions of __asan_load* and __asan_load*_noabort, because > > -fno-sanitize-recover=kernel-address will never work with the linux kernel. > > > > I already said this before, and repeat this once again: > > There is few places in kernel where we validly touch poisoned memory, > > so we need to disable error reporting in runtime for such memory accesses. > > I use per-thread flag which is raised before the valid access to poisoned memory. > > This flag checked in __asan_report*() function. If it raised then we shouldn't print any error message, > > just silently exit from report. > > Can't you just use __attribute__((no_sanitize_address)) on the functions > that have such a code? Or you could use special macros for those accesses > (which could e.g. call function to read memory or write memory, implemented > in assembly or in __attribute__((no_sanitize_address)) function), or > temporarily unpoison and poison again. Also, if you always rely on recovery for kernel-address, wonder why all the effort to make it optional (when it could be decided based on flag_sanitize & SANITIZE_KERNEL_ADDRESS), and whether I should wait with 4.9.2-rc1 for that (given that 4.9 branch now has kasan support backported, but not -fsanitize-recover (neither old style, nor new style)). I'd really like to release 4.9.2 soon... Jakub