From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26620 invoked by alias); 16 Feb 2015 16:01:07 -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 26605 invoked by uid 89); 16 Feb 2015 16:01:07 -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,T_RP_MATCHES_RCVD 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; Mon, 16 Feb 2015 16:01:06 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1GG141j027936 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 16 Feb 2015 11:01:04 -0500 Received: from tucnak.zalov.cz (ovpn-116-28.ams2.redhat.com [10.36.116.28]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t1GG13mS021023 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Mon, 16 Feb 2015 11:01:04 -0500 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.14.9/8.14.9) with ESMTP id t1GG11pv023569; Mon, 16 Feb 2015 17:01:01 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.14.9/8.14.9/Submit) id t1GG10eH022557; Mon, 16 Feb 2015 17:01:00 +0100 Date: Mon, 16 Feb 2015 16:01:00 -0000 From: Jakub Jelinek To: Ilya Enkovich Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH, CHKP, PR target/65044] Restrict pointer bounds checker with Sanitizer Message-ID: <20150216160100.GH1746@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <20150216152059.GA51560@msticlxl57.ims.intel.com> <20150216153154.GF1746@tucnak.redhat.com> <20150216155645.GB51560@msticlxl57.ims.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150216155645.GB51560@msticlxl57.ims.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-02/txt/msg00959.txt.bz2 On Mon, Feb 16, 2015 at 06:56:45PM +0300, Ilya Enkovich wrote: > On 16 Feb 16:31, Jakub Jelinek wrote: > > On Mon, Feb 16, 2015 at 06:20:59PM +0300, Ilya Enkovich wrote: > > > This patch restricts usage of Pointer Bounds Checker with Sanitizer. OK for trunk? > > > > There are many sanitizers, and for most of them I don't see why they would > > be in any conflict with -mmpx, it is just -fsanitize=address and > > -fsanitize=kernel-address. > > So perhaps test instead if (flag_sanitize & SANITIZE_ADDRESS) != 0, and > > better clear the flag_pointer_bounds after issuing the error, error () is > > not a fatal function, so you need something sensible for error-recovery. > > > > Jakub > > I don't know all sanitizers in details. Code generated by some of them may be incorrect from checker point of view. Thus I just wanted to disable unexplored and untested combinations. Shouldn't be that hard to write a testcase and test it. Most of the sanitizers just add code like if (some_condition) __ubsan_handle_... (); where from the POV of the program the __ubsan_* function reports or might report some problem, and optionally abort the program. That some_condition can be a check of the pointer value, shift count, divisor check, etc. Jakub