From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F2DFCA9EA0 for ; Fri, 18 Oct 2019 18:33:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6835E20869 for ; Fri, 18 Oct 2019 18:33:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="O7PltKw1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2505831AbfJRSdH (ORCPT ); Fri, 18 Oct 2019 14:33:07 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:42253 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2502579AbfJRSdG (ORCPT ); Fri, 18 Oct 2019 14:33:06 -0400 Received: by mail-lf1-f65.google.com with SMTP id z12so5420003lfj.9 for ; Fri, 18 Oct 2019 11:33:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GbeDXmo9y5jCjWaekiMahqEUs5l1VadqHf+/T7BBGBs=; b=O7PltKw1VMi2RMM6PRtWFNe7pkAjXUVERibQ18qTBqg7hBcss0b4ODK8OPurRIOyua XPNO9lzWQL2sUCEhn5yIUWxen7VKw9wyTrwnHMKPZjCRfIiXPFfWEAVvv4QRuiFlh5t+ pDRldcEsIeZnSgRVmFGygqa8PjlBtiqr3OTvL/LcpFDouIoV77L0apIZSU2+TZrDMUpN J+BIMIzJe4Gnl2MdVigjlwfITa9bcZsVYbInVJd7VmqoxFJ+R1oQWwmYYSQ+CRxNdp2b XI5aTFXOgs9ze9UHzbxQYe24jao6bo43OiCrhgGontQOfGlZavqZSXXnyWO9GEdwqm9A B7LA== 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=GbeDXmo9y5jCjWaekiMahqEUs5l1VadqHf+/T7BBGBs=; b=ewtgxWtwu4WzUkSgK9JBnIlD7GS/OWV4Cb1k9p4aGjSWzm2nN2s2Zjr/vGi5UOtOm8 n+0/2vX6fiD9tmo2/BohaEYJB4o+9aGGWsiXAxZMnl83oAMQcj+yCtX5JDof8p5elWCw kleHZKYK4aFoOV7u+KLMGzfx0jSXJKHFirfhZviAjIe3S7S2x9B4oqXhgvcaVHNntK/9 kWWnJFfbu3QK6mg96qel+IravZSzZw7xDir3Cv/OFtAxqbVw+f+PezK/0YEx+n5kiAHO M1Ewb7EZO/VSrBU9G1s6uSwjpotVRH0onI96/KNQV+AZY1qiHHbgWENTt/jhgfOn1+LD TjUg== X-Gm-Message-State: APjAAAWW7S3PS73xa1fwgUNUy6bFL62FCPwDawIeMCffDz/wnBiWbrpc GzrKzV6O+Rj4PVRzaZJDe3+GwJclAb7jjkmTzf0= X-Google-Smtp-Source: APXvYqwxRkqeBTGe2ipFXhHWevOzmHfCv3O5pvZN9gCYzK7L+ln0quOJ8iSVEtAb24QIwyqCIFqfSWgnDz92fMJhPwc= X-Received: by 2002:ac2:55b4:: with SMTP id y20mr6942077lfg.173.1571423584708; Fri, 18 Oct 2019 11:33:04 -0700 (PDT) MIME-Version: 1.0 References: <20191018161033.261971-1-samitolvanen@google.com> <20191018161033.261971-7-samitolvanen@google.com> In-Reply-To: From: Miguel Ojeda Date: Fri, 18 Oct 2019 20:32:53 +0200 Message-ID: Subject: Re: [PATCH 06/18] add support for Clang's Shadow Call Stack (SCS) To: Sami Tolvanen Cc: Nick Desaulniers , Will Deacon , Catalin Marinas , Steven Rostedt , Ard Biesheuvel , Dave Martin , Kees Cook , Laura Abbott , Mark Rutland , clang-built-linux , Kernel Hardening , Linux ARM , LKML 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 Fri, Oct 18, 2019 at 7:11 PM Sami Tolvanen wrote: > > On Fri, Oct 18, 2019 at 10:08 AM 'Nick Desaulniers' via Clang Built > Linux wrote: > > > diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h > > > index 333a6695a918..9af08391f205 100644 > > > --- a/include/linux/compiler-clang.h > > > +++ b/include/linux/compiler-clang.h > > > @@ -42,3 +42,5 @@ > > > * compilers, like ICC. > > > */ > > > #define barrier() __asm__ __volatile__("" : : : "memory") > > > + > > > +#define __noscs __attribute__((no_sanitize("shadow-call-stack"))) > > > > It looks like this attribute, (and thus a requirement to use this > > feature), didn't exist until Clang 7.0: https://godbolt.org/z/p9u1we > > (as noted above) > > > > I think it's better to put __noscs behind a __has_attribute guard in > > include/linux/compiler_attributes.h. Otherwise, what will happen when > > Clang 6.0 sees __noscs, for example? (-Wunknown-sanitizers will > > happen). > > Good point, I'll fix this in v2. Thanks. +1, please CC whenever you send it! Cheers, Miguel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4462ACA9EA0 for ; Fri, 18 Oct 2019 18:33:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1B05920869 for ; Fri, 18 Oct 2019 18:33:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="g9ZudLlZ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="O7PltKw1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B05920869 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=purByqfRciZNHqvkRP3HR6hMVbFayVyZRNz9VqKseTc=; b=g9ZudLlZVLL0ZU SMmdmLSULdo9GA4ts5eM9+X25h7Iib/vQ0fIj8LBE8K8/NrqR9YRpi1V7lve6di0Z1ba5rDZQNeKT ETF+iFjM7sxLuj2mba58tf7Hj1p4r3sXP2EfnS9O1eyLaNP6QzjEDJ4CWiXgIUA/cWhYYNHVlCQBf jzn58p+bmstSCF4fuISYd77YyrmCQ05Md6tsf6+3b85hh53Xe/61LSI3Epb2HxTpONfjESSlEIyVU F+klktgY1VYJOyZgsZmdY902Q0QzyCapfASfdi8dDSDGmOYc9z3FkpWkIalNFtLinUIO/VQKVbD2I w4+tYpxY/3uqrJgjTW8w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iLX3m-0007QF-0B; Fri, 18 Oct 2019 18:33:10 +0000 Received: from mail-lf1-x144.google.com ([2a00:1450:4864:20::144]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iLX3j-0007Pb-6E for linux-arm-kernel@lists.infradead.org; Fri, 18 Oct 2019 18:33:08 +0000 Received: by mail-lf1-x144.google.com with SMTP id q28so2169138lfa.5 for ; Fri, 18 Oct 2019 11:33:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GbeDXmo9y5jCjWaekiMahqEUs5l1VadqHf+/T7BBGBs=; b=O7PltKw1VMi2RMM6PRtWFNe7pkAjXUVERibQ18qTBqg7hBcss0b4ODK8OPurRIOyua XPNO9lzWQL2sUCEhn5yIUWxen7VKw9wyTrwnHMKPZjCRfIiXPFfWEAVvv4QRuiFlh5t+ pDRldcEsIeZnSgRVmFGygqa8PjlBtiqr3OTvL/LcpFDouIoV77L0apIZSU2+TZrDMUpN J+BIMIzJe4Gnl2MdVigjlwfITa9bcZsVYbInVJd7VmqoxFJ+R1oQWwmYYSQ+CRxNdp2b XI5aTFXOgs9ze9UHzbxQYe24jao6bo43OiCrhgGontQOfGlZavqZSXXnyWO9GEdwqm9A B7LA== 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=GbeDXmo9y5jCjWaekiMahqEUs5l1VadqHf+/T7BBGBs=; b=i0/uDLBAEmNHk8SqBato1YGJJsYtOyuR3ftr1On2gZ0PUb+cD3H1x/O7OSh53gF5GU fYj8b4NT/NCAiVQ4nUUmlFU+OMpXw5kz3PDrDCoUPByfXqRNWgznFQXIezNkatQPJChD 244bZXlQpdyLYE1THDEvz1gYE9klx4upyRzueBza2uAgpo2ZMaKpR/dSOq5J4/WiY3LX TFaW3KclPvfDYApAfP0M8zaLb8MWdFo6SlGMVTMru0Vx61+cIZ5jrlWRNj0ippGQ948P HvVskfzzXSiaxBzC/Zb+AxMKR/Yq4qT6u/YzUZ2FZSLwKXKMLV8xSTCtczVfaahxfAY3 sjaA== X-Gm-Message-State: APjAAAUYg4uLxYVHIQD3oaYSX6XrYlQQDTpVeY0iEQlKbqzUvm5SBO3b e0VPOH7Ecf3KnN2kFlXUOvea+Zwyg9hNx1tiLBk= X-Google-Smtp-Source: APXvYqwxRkqeBTGe2ipFXhHWevOzmHfCv3O5pvZN9gCYzK7L+ln0quOJ8iSVEtAb24QIwyqCIFqfSWgnDz92fMJhPwc= X-Received: by 2002:ac2:55b4:: with SMTP id y20mr6942077lfg.173.1571423584708; Fri, 18 Oct 2019 11:33:04 -0700 (PDT) MIME-Version: 1.0 References: <20191018161033.261971-1-samitolvanen@google.com> <20191018161033.261971-7-samitolvanen@google.com> In-Reply-To: From: Miguel Ojeda Date: Fri, 18 Oct 2019 20:32:53 +0200 Message-ID: Subject: Re: [PATCH 06/18] add support for Clang's Shadow Call Stack (SCS) To: Sami Tolvanen X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191018_113307_234588_55C78066 X-CRM114-Status: GOOD ( 13.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Kees Cook , Ard Biesheuvel , Catalin Marinas , Kernel Hardening , Nick Desaulniers , LKML , Steven Rostedt , clang-built-linux , Laura Abbott , Will Deacon , Dave Martin , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Oct 18, 2019 at 7:11 PM Sami Tolvanen wrote: > > On Fri, Oct 18, 2019 at 10:08 AM 'Nick Desaulniers' via Clang Built > Linux wrote: > > > diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h > > > index 333a6695a918..9af08391f205 100644 > > > --- a/include/linux/compiler-clang.h > > > +++ b/include/linux/compiler-clang.h > > > @@ -42,3 +42,5 @@ > > > * compilers, like ICC. > > > */ > > > #define barrier() __asm__ __volatile__("" : : : "memory") > > > + > > > +#define __noscs __attribute__((no_sanitize("shadow-call-stack"))) > > > > It looks like this attribute, (and thus a requirement to use this > > feature), didn't exist until Clang 7.0: https://godbolt.org/z/p9u1we > > (as noted above) > > > > I think it's better to put __noscs behind a __has_attribute guard in > > include/linux/compiler_attributes.h. Otherwise, what will happen when > > Clang 6.0 sees __noscs, for example? (-Wunknown-sanitizers will > > happen). > > Good point, I'll fix this in v2. Thanks. +1, please CC whenever you send it! Cheers, Miguel _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1647FCA9EA9 for ; Fri, 18 Oct 2019 18:33:24 +0000 (UTC) Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.kernel.org (Postfix) with SMTP id 62AE220869 for ; Fri, 18 Oct 2019 18:33:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="O7PltKw1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 62AE220869 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernel-hardening-return-17056-kernel-hardening=archiver.kernel.org@lists.openwall.com Received: (qmail 30656 invoked by uid 550); 18 Oct 2019 18:33:16 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Received: (qmail 30629 invoked from network); 18 Oct 2019 18:33:16 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GbeDXmo9y5jCjWaekiMahqEUs5l1VadqHf+/T7BBGBs=; b=O7PltKw1VMi2RMM6PRtWFNe7pkAjXUVERibQ18qTBqg7hBcss0b4ODK8OPurRIOyua XPNO9lzWQL2sUCEhn5yIUWxen7VKw9wyTrwnHMKPZjCRfIiXPFfWEAVvv4QRuiFlh5t+ pDRldcEsIeZnSgRVmFGygqa8PjlBtiqr3OTvL/LcpFDouIoV77L0apIZSU2+TZrDMUpN J+BIMIzJe4Gnl2MdVigjlwfITa9bcZsVYbInVJd7VmqoxFJ+R1oQWwmYYSQ+CRxNdp2b XI5aTFXOgs9ze9UHzbxQYe24jao6bo43OiCrhgGontQOfGlZavqZSXXnyWO9GEdwqm9A B7LA== 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=GbeDXmo9y5jCjWaekiMahqEUs5l1VadqHf+/T7BBGBs=; b=bWKZFnLmnoOl0Gj1Tqtbbo+4uLA69cpoZNNToK5O0xTd1RuzMIxi3VHqiKoh6pDuzl meXEYhXog3RqfWyXlqAhXbcKAzS4QY2oA1DRzPV+RpBNELDNoai0DJcqH+qz9peobjjE n6O9tEVWtuP2oZ/dKNOsH4IOnO7JqvE7fF96hfHLcS/zNqi0pbY8Fw7CVbWgL1A4Pfip WWXBMh6jW9JMr2b5nJasMV1CHwC+hcGdOwY1m7yZZvWqA7Pl77QWveGkLAEelWwCP5wZ ZhAIkSKQC2vvOJiODqa/exXVVMC93Ci+LuJztJYENSMp7hsg68/ChNhhySWpMMuFa0er PV5Q== X-Gm-Message-State: APjAAAW+t2zo53zKClrgY7V2csiMV8AkStpPKj0cE0yUw2g9SiSoga0N FmR6C7NclFBhLluJmFSehWxMuSv/D0rXIzSetfs= X-Google-Smtp-Source: APXvYqwxRkqeBTGe2ipFXhHWevOzmHfCv3O5pvZN9gCYzK7L+ln0quOJ8iSVEtAb24QIwyqCIFqfSWgnDz92fMJhPwc= X-Received: by 2002:ac2:55b4:: with SMTP id y20mr6942077lfg.173.1571423584708; Fri, 18 Oct 2019 11:33:04 -0700 (PDT) MIME-Version: 1.0 References: <20191018161033.261971-1-samitolvanen@google.com> <20191018161033.261971-7-samitolvanen@google.com> In-Reply-To: From: Miguel Ojeda Date: Fri, 18 Oct 2019 20:32:53 +0200 Message-ID: Subject: Re: [PATCH 06/18] add support for Clang's Shadow Call Stack (SCS) To: Sami Tolvanen Cc: Nick Desaulniers , Will Deacon , Catalin Marinas , Steven Rostedt , Ard Biesheuvel , Dave Martin , Kees Cook , Laura Abbott , Mark Rutland , clang-built-linux , Kernel Hardening , Linux ARM , LKML Content-Type: text/plain; charset="UTF-8" On Fri, Oct 18, 2019 at 7:11 PM Sami Tolvanen wrote: > > On Fri, Oct 18, 2019 at 10:08 AM 'Nick Desaulniers' via Clang Built > Linux wrote: > > > diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h > > > index 333a6695a918..9af08391f205 100644 > > > --- a/include/linux/compiler-clang.h > > > +++ b/include/linux/compiler-clang.h > > > @@ -42,3 +42,5 @@ > > > * compilers, like ICC. > > > */ > > > #define barrier() __asm__ __volatile__("" : : : "memory") > > > + > > > +#define __noscs __attribute__((no_sanitize("shadow-call-stack"))) > > > > It looks like this attribute, (and thus a requirement to use this > > feature), didn't exist until Clang 7.0: https://godbolt.org/z/p9u1we > > (as noted above) > > > > I think it's better to put __noscs behind a __has_attribute guard in > > include/linux/compiler_attributes.h. Otherwise, what will happen when > > Clang 6.0 sees __noscs, for example? (-Wunknown-sanitizers will > > happen). > > Good point, I'll fix this in v2. Thanks. +1, please CC whenever you send it! Cheers, Miguel