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_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,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 928CBC433DF for ; Mon, 29 Jun 2020 21:06:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6F75820768 for ; Mon, 29 Jun 2020 21:06:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LqI1i8wz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390313AbgF2VGf (ORCPT ); Mon, 29 Jun 2020 17:06:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387498AbgF2VGX (ORCPT ); Mon, 29 Jun 2020 17:06:23 -0400 Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27A9BC061755; Mon, 29 Jun 2020 14:06:23 -0700 (PDT) Received: by mail-qt1-x841.google.com with SMTP id z2so14024217qts.5; Mon, 29 Jun 2020 14:06:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=doBBGB7xlE5VTXsZgCgPieACb98RUxeYYlyjRqBYqwk=; b=LqI1i8wzqXm8nU2Ic1Xkncf9ppAoV7PBHkxQVw49w+S1bUMRA+mPYwotwm1xevj+wz W7EprSOUg3PFhG5CK6k3/cDlwyEbzt528fqOgPyORXJYnow9dML18ccBtnqZJa0UdbP8 f7kr1bzbgY0PbKRDt0Abfldoi/agCPG37BmIgJT9nW7J546oknUZM4hZiVXOCrNV9smK XGUkCXgopqK8G1MfzuL2Vf+yhTTvEPxPfxyb2lV+eZJ49nK25nTOmOpNG0bDxTKPO7Jb 6d2EuO6hIIQsf3ZYt5qo346hnRJUH4p0HrQMgsRCSErlVd5C9z0ucwkOvhk8rUv6mZf8 iEAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:date:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=doBBGB7xlE5VTXsZgCgPieACb98RUxeYYlyjRqBYqwk=; b=Mw7z0IPBrrKxo1cx6we3Bj8CJITITGTFu5TF3Ifee8VFhBJZk6S/WtkczAGhXvg/sz Fa22CDEo3ccaJ60bHmrxgb4pNiq1vD3/pM7BBRiwl71rA2ZRr0x6Da2xEf6GMcTxAU7c I181Iq7awoZmGByzhA1VjyeoQLSRzq0+jJ1jHMB5UVlCdkchBmFNQkM2MAdiwH2Fk5ii 69EBUufYGSg+nE4CMzZVgwLhymd/GY/SmA3OZltOisnDKHKXnD3oyHVUbYE+s7k9EcOF DhKoCsEB5qvNyT9WViMaE3iBfh85SVOGNCAG789JOA7qnXec9QmvcG9X4oA19y2upyRX 9Nvg== X-Gm-Message-State: AOAM531SLhhC8Rkiea0p2HbIu7PHEH8lmj5HKPYrl5sseOvbfDRV+5Kl KvkLdenNYAe6k1IccPG9JaY= X-Google-Smtp-Source: ABdhPJwWfhACQdRSjlXr+8tYrYr5Js2ar1sW///HmVXlxpOfUFTESwvc3U+xILMwk4hI3IsVsOzReg== X-Received: by 2002:ac8:48da:: with SMTP id l26mr17036060qtr.214.1593464782360; Mon, 29 Jun 2020 14:06:22 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id u68sm864480qkd.59.2020.06.29.14.06.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jun 2020 14:06:21 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Mon, 29 Jun 2020 17:06:19 -0400 To: Arvind Sankar Cc: Kees Cook , Nick Desaulniers , Will Deacon , Catalin Marinas , Mark Rutland , Ard Biesheuvel , Peter Collingbourne , James Morse , Borislav Petkov , Thomas Gleixner , Ingo Molnar , Russell King , Masahiro Yamada , Nathan Chancellor , Arnd Bergmann , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , clang-built-linux , linux-arch , linux-efi , Linux ARM , LKML , Joe Perches Subject: Re: [PATCH v4 08/17] arm64/mm: Remove needless section quotes Message-ID: <20200629210619.GA1603907@rani.riverdale.lan> References: <20200629061840.4065483-1-keescook@chromium.org> <20200629061840.4065483-9-keescook@chromium.org> <202006291301.46FEF3B7@keescook> <20200629205448.GA1474367@rani.riverdale.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200629205448.GA1474367@rani.riverdale.lan> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 29, 2020 at 04:54:48PM -0400, Arvind Sankar wrote: > On Mon, Jun 29, 2020 at 01:04:31PM -0700, Kees Cook wrote: > > On Mon, Jun 29, 2020 at 12:53:47PM -0700, Nick Desaulniers wrote: > > > On Sun, Jun 28, 2020 at 11:18 PM Kees Cook wrote: > > > > > > > > Fix a case of needless quotes in __section(), which Clang doesn't like. > > > > > > > > Acked-by: Will Deacon > > > > Signed-off-by: Kees Cook > > > > > > Yep, I remember bugs from this. Probably should scan the kernel for > > > other instances of this. +Joe for checkpatch.pl validation. > > > > I think the others are safe because they're in macros: > > Why does that make it safe -- the commit msg is a bit sparse, but I > assume the problem is that it generates > __attribute__((__section__("\".foo\""))) > from > __section(".foo") > after preprocessing, and clang keeps the quotes in the section name when > generating assembly, while gcc appears to strip them off. > > It does that even if nested in another macro, no? Yep, I can see things like: [25] ".discard.ksym" PROGBITS 0000000000000000 0000217c 0000000000000000 0000000000000000 WA 0 0 4 Doesn't seem to cause a build error, but that can't be good. > > > > > $ git grep -4 '__section("' > > include/linux/compiler.h-# define KENTRY(sym) \ > > Am I missing something, or is KENTRY unused in the tree? > > > include/linux/compiler.h- extern typeof(sym) sym; \ > > include/linux/compiler.h- static const unsigned long __kentry_##sym \ > > include/linux/compiler.h- __used \ > > include/linux/compiler.h: __section("___kentry" "+" #sym ) \ > > include/linux/compiler.h- = (unsigned long)&sym; > > -- > > include/linux/export.h-#define __ksym_marker(sym) \ > > include/linux/export.h: static int __ksym_marker_##sym[0] __section(".discard.ksym") __used > > -- > > include/linux/srcutree.h-# define __DEFINE_SRCU(name, is_static) \ > > include/linux/srcutree.h- is_static struct srcu_struct name; \ > > include/linux/srcutree.h- struct srcu_struct * const __srcu_struct_##name \ > > include/linux/srcutree.h: __section("___srcu_struct_ptrs") = &name > > > > > > > Reviewed-by: Nick Desaulniers > > > > Thanks! > > > > -- > > Kees Cook From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arvind Sankar Subject: Re: [PATCH v4 08/17] arm64/mm: Remove needless section quotes Date: Mon, 29 Jun 2020 17:06:19 -0400 Message-ID: <20200629210619.GA1603907@rani.riverdale.lan> References: <20200629061840.4065483-1-keescook@chromium.org> <20200629061840.4065483-9-keescook@chromium.org> <202006291301.46FEF3B7@keescook> <20200629205448.GA1474367@rani.riverdale.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Return-path: Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387498AbgF2VGX (ORCPT ); Mon, 29 Jun 2020 17:06:23 -0400 Content-Disposition: inline In-Reply-To: <20200629205448.GA1474367@rani.riverdale.lan> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Arvind Sankar Cc: Kees Cook , Nick Desaulniers , Will Deacon , Catalin Marinas , Mark Rutland , Ard Biesheuvel , Peter Collingbourne , James Morse , Borislav Petkov , Thomas Gleixner , Ingo Molnar , Russell King , Masahiro Yamada , Nathan Chancellor , Arnd Bergmann , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , clang-built-linux , linux-arch , linux-efi On Mon, Jun 29, 2020 at 04:54:48PM -0400, Arvind Sankar wrote: > On Mon, Jun 29, 2020 at 01:04:31PM -0700, Kees Cook wrote: > > On Mon, Jun 29, 2020 at 12:53:47PM -0700, Nick Desaulniers wrote: > > > On Sun, Jun 28, 2020 at 11:18 PM Kees Cook wrote: > > > > > > > > Fix a case of needless quotes in __section(), which Clang doesn't like. > > > > > > > > Acked-by: Will Deacon > > > > Signed-off-by: Kees Cook > > > > > > Yep, I remember bugs from this. Probably should scan the kernel for > > > other instances of this. +Joe for checkpatch.pl validation. > > > > I think the others are safe because they're in macros: > > Why does that make it safe -- the commit msg is a bit sparse, but I > assume the problem is that it generates > __attribute__((__section__("\".foo\""))) > from > __section(".foo") > after preprocessing, and clang keeps the quotes in the section name when > generating assembly, while gcc appears to strip them off. > > It does that even if nested in another macro, no? Yep, I can see things like: [25] ".discard.ksym" PROGBITS 0000000000000000 0000217c 0000000000000000 0000000000000000 WA 0 0 4 Doesn't seem to cause a build error, but that can't be good. > > > > > $ git grep -4 '__section("' > > include/linux/compiler.h-# define KENTRY(sym) \ > > Am I missing something, or is KENTRY unused in the tree? > > > include/linux/compiler.h- extern typeof(sym) sym; \ > > include/linux/compiler.h- static const unsigned long __kentry_##sym \ > > include/linux/compiler.h- __used \ > > include/linux/compiler.h: __section("___kentry" "+" #sym ) \ > > include/linux/compiler.h- = (unsigned long)&sym; > > -- > > include/linux/export.h-#define __ksym_marker(sym) \ > > include/linux/export.h: static int __ksym_marker_##sym[0] __section(".discard.ksym") __used > > -- > > include/linux/srcutree.h-# define __DEFINE_SRCU(name, is_static) \ > > include/linux/srcutree.h- is_static struct srcu_struct name; \ > > include/linux/srcutree.h- struct srcu_struct * const __srcu_struct_##name \ > > include/linux/srcutree.h: __section("___srcu_struct_ptrs") = &name > > > > > > > Reviewed-by: Nick Desaulniers > > > > Thanks! > > > > -- > > Kees Cook 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=-4.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 EBEB7C433E0 for ; Mon, 29 Jun 2020 21:07:46 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 BB528206A1 for ; Mon, 29 Jun 2020 21:07:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="UpqLUJop"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LqI1i8wz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BB528206A1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=alum.mit.edu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:Date:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=87exTemAL9dcuG5IN15Gy2zt5wOddQ+l84hBfHABM7Y=; b=UpqLUJopS+jVTS8HN1jgyNflM N5Lf/lPJo3uyjC+piQ2sb7auxP4qOQ/dYKbsaFcvmf5b8UnW6j1FEgFER2UW4lXivPKljnPYxQnO/ UswSzx/SFMMNNaPh0xotUxRQSyJmgQMmHxNs6fK8o7H5+0Rsfu8i6ikzK7dbQivM1VbjOzbzJJqam Vg1k+Sbvxd5RkN6UPX9M7yeXJ9YiQ9jW9gOKvnMQmEIr2fKp1KPnGz2ixVQ2anHluJ6LxHCIpEHvT bWSMfvWpHziaC5a3T5vs2ClxNVoTfGr2VGhKkiDQI/8xKsOwB+eJmkeThBERzQeDPJ2ZLlwwmW8I2 uSjSrmLyg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jq0yw-0005An-Vs; Mon, 29 Jun 2020 21:06:27 +0000 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jq0yt-0005A5-Sg for linux-arm-kernel@lists.infradead.org; Mon, 29 Jun 2020 21:06:24 +0000 Received: by mail-qt1-x844.google.com with SMTP id q22so7494151qtl.2 for ; Mon, 29 Jun 2020 14:06:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=doBBGB7xlE5VTXsZgCgPieACb98RUxeYYlyjRqBYqwk=; b=LqI1i8wzqXm8nU2Ic1Xkncf9ppAoV7PBHkxQVw49w+S1bUMRA+mPYwotwm1xevj+wz W7EprSOUg3PFhG5CK6k3/cDlwyEbzt528fqOgPyORXJYnow9dML18ccBtnqZJa0UdbP8 f7kr1bzbgY0PbKRDt0Abfldoi/agCPG37BmIgJT9nW7J546oknUZM4hZiVXOCrNV9smK XGUkCXgopqK8G1MfzuL2Vf+yhTTvEPxPfxyb2lV+eZJ49nK25nTOmOpNG0bDxTKPO7Jb 6d2EuO6hIIQsf3ZYt5qo346hnRJUH4p0HrQMgsRCSErlVd5C9z0ucwkOvhk8rUv6mZf8 iEAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:date:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=doBBGB7xlE5VTXsZgCgPieACb98RUxeYYlyjRqBYqwk=; b=o92qehjW3JnscnAcu51My6ZWeUWj7Zk5AztU6WERG9Fkk4fxKJYinlB+n/mVTcuoWK qjdghAf2Vj3i3mdBj1LD4wWC4dosL1JU2dymgVdrd2zeKDYa3uCYDWHb6oofruGUJPzr 6xj3eHCAiYMNP+GdeyUITpj5WB1vLHiiiLAGEq9bZlZpEO/e+XhDsh23cmU0i1deZdpH LyppC+rNvhl1Y/jeLyr1CFuWkzGeO3AOFZjAj+fN0Eiv6D/C2PnFUnoAAgz/CMEVUYlO 7BgtwtsVmhxB5nhD5rOy8HkYrre7jfp5NLdiO0wktmjzt4kZMMw4kkpC408tUybaHJLZ knGA== X-Gm-Message-State: AOAM533vHIYZ9Vtmjn8JjB8xD3QtE+mVimpWHCTGwDoyYf53HiCuMr7W oXRpDwD+/1L1b0tTbpkbs5s= X-Google-Smtp-Source: ABdhPJwWfhACQdRSjlXr+8tYrYr5Js2ar1sW///HmVXlxpOfUFTESwvc3U+xILMwk4hI3IsVsOzReg== X-Received: by 2002:ac8:48da:: with SMTP id l26mr17036060qtr.214.1593464782360; Mon, 29 Jun 2020 14:06:22 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id u68sm864480qkd.59.2020.06.29.14.06.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jun 2020 14:06:21 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Mon, 29 Jun 2020 17:06:19 -0400 To: Arvind Sankar Subject: Re: [PATCH v4 08/17] arm64/mm: Remove needless section quotes Message-ID: <20200629210619.GA1603907@rani.riverdale.lan> References: <20200629061840.4065483-1-keescook@chromium.org> <20200629061840.4065483-9-keescook@chromium.org> <202006291301.46FEF3B7@keescook> <20200629205448.GA1474367@rani.riverdale.lan> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200629205448.GA1474367@rani.riverdale.lan> 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 , linux-efi , Catalin Marinas , Will Deacon , Thomas Gleixner , linux-arch , Masahiro Yamada , "maintainer:X86 ARCHITECTURE \(32-BIT AND 64-BIT\)" , Russell King , Ard Biesheuvel , clang-built-linux , Ingo Molnar , Borislav Petkov , Kees Cook , Arnd Bergmann , Nathan Chancellor , Peter Collingbourne , Linux ARM , Nick Desaulniers , LKML , James Morse , Joe Perches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jun 29, 2020 at 04:54:48PM -0400, Arvind Sankar wrote: > On Mon, Jun 29, 2020 at 01:04:31PM -0700, Kees Cook wrote: > > On Mon, Jun 29, 2020 at 12:53:47PM -0700, Nick Desaulniers wrote: > > > On Sun, Jun 28, 2020 at 11:18 PM Kees Cook wrote: > > > > > > > > Fix a case of needless quotes in __section(), which Clang doesn't like. > > > > > > > > Acked-by: Will Deacon > > > > Signed-off-by: Kees Cook > > > > > > Yep, I remember bugs from this. Probably should scan the kernel for > > > other instances of this. +Joe for checkpatch.pl validation. > > > > I think the others are safe because they're in macros: > > Why does that make it safe -- the commit msg is a bit sparse, but I > assume the problem is that it generates > __attribute__((__section__("\".foo\""))) > from > __section(".foo") > after preprocessing, and clang keeps the quotes in the section name when > generating assembly, while gcc appears to strip them off. > > It does that even if nested in another macro, no? Yep, I can see things like: [25] ".discard.ksym" PROGBITS 0000000000000000 0000217c 0000000000000000 0000000000000000 WA 0 0 4 Doesn't seem to cause a build error, but that can't be good. > > > > > $ git grep -4 '__section("' > > include/linux/compiler.h-# define KENTRY(sym) \ > > Am I missing something, or is KENTRY unused in the tree? > > > include/linux/compiler.h- extern typeof(sym) sym; \ > > include/linux/compiler.h- static const unsigned long __kentry_##sym \ > > include/linux/compiler.h- __used \ > > include/linux/compiler.h: __section("___kentry" "+" #sym ) \ > > include/linux/compiler.h- = (unsigned long)&sym; > > -- > > include/linux/export.h-#define __ksym_marker(sym) \ > > include/linux/export.h: static int __ksym_marker_##sym[0] __section(".discard.ksym") __used > > -- > > include/linux/srcutree.h-# define __DEFINE_SRCU(name, is_static) \ > > include/linux/srcutree.h- is_static struct srcu_struct name; \ > > include/linux/srcutree.h- struct srcu_struct * const __srcu_struct_##name \ > > include/linux/srcutree.h: __section("___srcu_struct_ptrs") = &name > > > > > > > Reviewed-by: Nick Desaulniers > > > > Thanks! > > > > -- > > Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel