From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 95307 invoked by alias); 20 Jun 2017 12:27:11 -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 95231 invoked by uid 89); 20 Jun 2017 12:27:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,UNSUBSCRIBE_BODY autolearn=no version=3.3.2 spammy=kidding X-HELO: mail-oi0-f43.google.com Received: from mail-oi0-f43.google.com (HELO mail-oi0-f43.google.com) (209.85.218.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 20 Jun 2017 12:27:08 +0000 Received: by mail-oi0-f43.google.com with SMTP id p187so12992172oif.3 for ; Tue, 20 Jun 2017 05:27:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=3Pfzk2X4X7rKVv/q1tqIuHtaOGc6R54lWMdawubpoL0=; b=LcGyTnL9+keo1x5DlTv939oSWOSUFdUYNheCC1ibnVPGg3uR1bSLx2cpRM6a35fjon rDv5KglujgrJDP/KeOHfIkVLDMM+NtK/BxA0cKllABUwVVKsOc/FPegqBwhO85LfivMK uLMYyw/ZObsQeaNoX147UWnyRzKsr0obVBxozJkGwG4sQp7tm6gXxYvuig8obvEQ715/ iQavAqLaxJ6xKpHgpealKDT7ghmSKnSint2bZHyzGrfufenc60R9XC6JV9QkN5WYnhdZ pud7OeqW76Gq3916RyY0tRtphcAv+pil2Pl+MQqjwaVyCZ2/VSRDEK+NlYhOdj08QI+e vbFA== X-Gm-Message-State: AKS2vOyNoqZgcIo61vcSrE0YcFLQY1ZoURPe0Zm+8NHcR62PbybX/1Wf BZKM9M5RjHou0g46YukPhoogYdxUaA== X-Received: by 10.202.187.6 with SMTP id l6mr13070543oif.99.1497961626858; Tue, 20 Jun 2017 05:27:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.37.66 with HTTP; Tue, 20 Jun 2017 05:27:05 -0700 (PDT) In-Reply-To: References: <20170619172932.GV2123@tucnak> <6b026ac5-7b68-f93b-e005-17288163f442@redhat.com> <20170619175149.GY2123@tucnak> <09134f33-7f93-752d-c069-f86819191dd4@redhat.com> From: Richard Biener Date: Tue, 20 Jun 2017 12:27:00 -0000 Message-ID: Subject: Re: RFC: stack/heap collision vulnerability and mitigation with GCC To: Uros Bizjak Cc: Florian Weimer , Jakub Jelinek , Jeff Law , Jan Hubicka , Eric Botcazou , gcc-patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg01446.txt.bz2 On Tue, Jun 20, 2017 at 2:20 PM, Uros Bizjak wrote: > On Tue, Jun 20, 2017 at 2:17 PM, Uros Bizjak wrote: >> On Tue, Jun 20, 2017 at 2:13 PM, Florian Weimer wrote: >>> On 06/20/2017 01:10 PM, Uros Bizjak wrote: >>> >>>> 74,99% a.out a.out [.] test_or >>>> 12,50% a.out a.out [.] test_movb >>>> 12,50% a.out a.out [.] test_movl >>> >>> Could you try notl/notb/negl/negb as well, please? >> >> These all have the same (long) runtime as test_or. > > Perhaps we can use "testb $0, %0"? It doesn't write to the memory, but > otherwise has the same runtime as movb/movl. That sounds good, OTOH it's a matter of putting strain on the memory fetch or store side... We'll get cacheline allocations in any case (but the memory will be used eventually). Instead of test a mere movb into a scratch register (aka, load instead of store) would work as well apart from the need of a scratch register. We can also vectorize with scatters ;) (just kidding) Richard. > Uros.