Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2949638imm; Thu, 24 May 2018 19:43:13 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqnNMj8C8RrDG5VKTHQlvkjaTPfmnRNItxRF9ar076SlctOv6l6I+qjKzbqp26I6+cemNkk X-Received: by 2002:a17:902:8305:: with SMTP id bd5-v6mr606329plb.13.1527216193000; Thu, 24 May 2018 19:43:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527216192; cv=none; d=google.com; s=arc-20160816; b=Wds4TW41idiVGdbWa8ZSPe/FXp/sAsBqFX5dlzfaAf+feQLmylq5JEflmIpJ0IKHrH 0tuKka142aU2SvW/87D5RLI7pAzBX/rK8wHsTg71gksmNJ1WPkkzqiTqtnL80WTrn6x9 k8jzMONTlvK+01tcrA/x981XY7kf0obMiVBkVQ4oJzYog4Hx+XsdKKtC79PecvlrGphl Rodd6n2DnXDs5nU/CvfTDTB32IBsA8+IdbfPCbY/vhjbeqtqnVr/gc6YxKyrXxBr5nrs dnDRHL7YPLnNRtpq61nSGVJ6PrcZIwjCb4NHxmDS7AXKGyslJ3o/MvdfA7znog8oCPXl PNoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=doJvM8WSmqIBWabD6hxBvYfe9GT9S2BL2/X3nedctbg=; b=X6uTE8BhMm/es9eMZ1PfT0tS77BX1fsyJIIeSXY6Q9YwsyyTUcUm/oape0GBf3ar8D rssOzLhtfbkMVeraKONF1vk/Sr3T32IlFTtf6xM8XttP3cZS3+iN1yF0gcMGlp5cwr1E Cegup+6PnYmcvXPCVkSkCY46cGEnvFE/cNz1Vh/WM50FNMmoIQTz4gMVVVY9lr1+Vrm3 07htAGFabf/TYOIjx+XPt9PPmnfbwaOUTOV3ivnhLzB7AoKRWisRd0oOAQRbAFjJreOx ihr02nZ+UC/HJpK8X3jnzCJWDCyUE1YElza5crrzKKsW3GhUY1bFO1Xw2cYFO0x1d/+1 aFAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=XyWL78Ib; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s14-v6si17363392pgf.640.2018.05.24.19.42.58; Thu, 24 May 2018 19:43:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=XyWL78Ib; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S971479AbeEXUwa (ORCPT + 99 others); Thu, 24 May 2018 16:52:30 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:41721 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966499AbeEXUw2 (ORCPT ); Thu, 24 May 2018 16:52:28 -0400 Received: by mail-pg0-f65.google.com with SMTP id d14-v6so1302406pgv.8 for ; Thu, 24 May 2018 13:52:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=doJvM8WSmqIBWabD6hxBvYfe9GT9S2BL2/X3nedctbg=; b=XyWL78IbuO7weh0oI7K2SPl/d3RcXrP94wWnFTQYiYS2OH+ufbE7sOhAKroO7qNNRs IO6cd+vwIU29g1iRbZHsfROT9ADQW/X3HOJdqaEjORfJQzy0t0bGMzMnx5KIshzflJxF +ihAQ/gvy5JnYez36jlz+heF3hExORmDQ306pHLpCGyeXWO4e23vhsy1hzVgFcWgPO8K kngMANFHuBrFLXvVw08atqUJcQSz39nUYFgPWCmpN1KS7cIOFs9fEVF+PUmCURGZ1Jtd u/4WNLXOZroN8v3KHbdr5OIoLi+xsm60SRkAWvuWc6+TKFiaofL0ebHAjBJ9fTOZ17Pi kHRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=doJvM8WSmqIBWabD6hxBvYfe9GT9S2BL2/X3nedctbg=; b=qKikPrb2M61Rdzi896K8jLCu9HS+518FLhWDE9bI9vLUxvEP0HfVaSa6RoXPuf3BCQ KXxz2xPEjkweCRbUkL/Jr83gFLf25ZHyG1PcAZf3E2ZGC5K16r11S7qK3Pyc2YrauZKW 6pnEKGSFVxHLTqYCvYOWEtC+8iYGPMJr1HFEAD9rLD+IvdK7vQ0xmqXiGRpFuq3pjGjV oC0eki0Q2hXR/ZBm9zWiClyMzquHLict43DcBiOGY7oT2jS24S4TNdMOJ0h2lh1yO+m/ F/IU3sPGBAodyLsv6KXJPqOjCdMk6EhUNOc91geTYV/QWtHfJ4dKMPH1oWok/nmRYQAX 9QXw== X-Gm-Message-State: ALKqPwcivs7xu1QPVFdhcwEAQ/Ke2cbUS0aEayhUSWTpy3ggPL4oAPvH QSjOKz8t+TwvU5tlo0pszaYY5hyKQuAW6rtHXpRvzQ== X-Received: by 2002:a63:a513:: with SMTP id n19-v6mr2284644pgf.381.1527195147809; Thu, 24 May 2018 13:52:27 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Nick Desaulniers Date: Thu, 24 May 2018 13:52:16 -0700 Message-ID: Subject: Re: [clang] stack protector and f1f029c7bf To: hpa@zytor.com Cc: Alistair Strachan , Manoj Gupta , Matthias Kaehlcke , Greg Hackmann , sedat.dilek@gmail.com, tstellar@redhat.com, LKML , Kees Cook Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 24, 2018 at 1:26 PM Nick Desaulniers wrote: > On Thu, May 24, 2018 at 11:59 AM wrote: > > Issue 3: Let's face it, reading and writing the flags should be builtins, > exactly because it has to do stack operations, which really means the > compiler should be involved. > I'm happy to propose that as a feature request to llvm+gcc. Oh, looks like both clang and gcc have: __builtin_ia32_readeflags_u64() https://godbolt.org/g/SwPjhq Maybe native_save_fl() and native_restore_fl() should be replaced in the kernel with __builtin_ia32_readeflags_u64() and __builtin_ia32_writeeflags_u64()? -- Thanks, ~Nick Desaulniers