Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4167946pxk; Tue, 29 Sep 2020 16:49:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzaZ+fIYsTweOaiwGXozxCsvqyA4zutjW+H2edBi+0XccrMuUt7fO8Vxy9u5V548a558J9Q X-Received: by 2002:a17:907:728e:: with SMTP id dt14mr55813ejc.505.1601423366112; Tue, 29 Sep 2020 16:49:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601423366; cv=none; d=google.com; s=arc-20160816; b=f8dyzGZm++poBoNJpUaBqWbnUwY7Xn+dRG6Ioobym+QBWTH94aNKGPG2CSwLqjnzyu tn8e7m5b3VpLnaAtNXa759uy37Plr+fwQqNCwPDEMYEfceowp63BMYkg/ZAMoxNGDWRZ jCbMSa+DF8WQwqTBrWvD3XPSJTLxeLhcf8QH/t3BVM9TeJBrjKkknIf/saw5Zbjt2UHG 8in1QP7t5H/PwBlW3dtxYbRHicHY/9EarKNwfrjqMA6sZETijNaG7n8CoprmglWomv5P iMrLV5CDyKPXPumZvIMX46X3phoHhBK7k3iQab9x4mB8QpreefdoRdydSGamlymUxJ3m xifQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=BE3IS0ree7QIjSeFdWMob24S2TufDcRFBlLIISZlO6M=; b=ZRxa3vByH+YOp9NoqIZ13+dKD/Pz6HMI08JyM9VyfWpzxDH2FgWwYlv+rD36jY0+MW sgx6OX4AzKiO9KzRxfMgj5f724b1h+TByNS4hn9BsvlfQLk2q2LJCiyipYlFlATjlJEH d6O8D5asjwC4Jwo26nZ3JDjwbOGh2Uul8ariydhui5rTbFCfhdOXMLbI3aOexw2EijAG Eqn6GPgp69CFDhPHKnik1/0ZuDzWnsVmegdF7EyF0jNnAeWez21Maf1ThrDEdUg04vIN U0reJqx9flshNBXtcepKNgcuCRtmvfNrq1qk8nrtBRrTLY3RV475aQ413krAnLiznZd9 cmLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=QXOBgazQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z10si16126ejr.89.2020.09.29.16.49.02; Tue, 29 Sep 2020 16:49:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=QXOBgazQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728684AbgI2XqC (ORCPT + 99 others); Tue, 29 Sep 2020 19:46:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728192AbgI2XqC (ORCPT ); Tue, 29 Sep 2020 19:46:02 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5537C0613D0 for ; Tue, 29 Sep 2020 16:46:01 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id x123so6402816pfc.7 for ; Tue, 29 Sep 2020 16:46:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=BE3IS0ree7QIjSeFdWMob24S2TufDcRFBlLIISZlO6M=; b=QXOBgazQg6wlfqddFVNOmR1+eQ18ANNoedSzhVTOd76Xb9OOzbsuJfr5rFfxMrMfhu YnIJwwUHOi0+iOL5DJILilajKT7+URNJ1ZG8ypreA9OSPm7I8EHA9g+QV2XFZMFeKA1M +eKJ6pajmTC/5hm6LrFI6NNsy1BbxGftvEmb4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=BE3IS0ree7QIjSeFdWMob24S2TufDcRFBlLIISZlO6M=; b=czWYmXXAtsz1jdaBs4ULsPc6sTqXHclPmYgb3epAKfi6J+UauPwbBkpcgRvweywg+u ANgl6PW41A2lO8WLnMXoig2E5U7/s8Jbq1svxBFbze5H/N7Lq/CKYoRHRMdyaVYgpS14 PEC968F7PPPCPQFGciJcAuC9EM/oRDTOT6+AZujsy50wY3yyViB8VcYup9enDkvJzG4t yvI8uRF3BhsAjQzmEQpApm7O10MUmy5rL65uTl0meEd3hZCH2Gg14iHhBdfnZLZfZRWQ 7NdRRWpiorERElnoZJVtgp8xl9DZtM/XUf4wd259kUDZHoc4MAbOfQ3Gqvmdstxj0KnM c1AQ== X-Gm-Message-State: AOAM530rn/Bm4il/o0RO5ypKoYssjj5SoFRimkfrzKvFVBhEPVQXPETh Lek8/vWEe++VIj9eqLcjqehd6Q== X-Received: by 2002:a63:511d:: with SMTP id f29mr4006pgb.11.1601423161354; Tue, 29 Sep 2020 16:46:01 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id i15sm6744827pfk.145.2020.09.29.16.46.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Sep 2020 16:46:00 -0700 (PDT) Date: Tue, 29 Sep 2020 16:45:59 -0700 From: Kees Cook To: Nick Desaulniers Cc: "Paul E . McKenney" , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Josh Triplett , linux-kernel@vger.kernel.org, rcu@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH v2] srcu: avoid escaped section names Message-ID: <202009291645.283040FE80@keescook> References: <20200929192549.501516-1-ndesaulniers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200929192549.501516-1-ndesaulniers@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 29, 2020 at 12:25:49PM -0700, Nick Desaulniers wrote: > The stringification operator, `#`, in the preprocessor escapes strings. > For example, `# "foo"` becomes `"\"foo\""`. GCC and Clang differ in how > they treat section names that contain \". > > The portable solution is to not use a string literal with the > preprocessor stringification operator. > > Link: https://bugs.llvm.org/show_bug.cgi?id=42950 > Fixes: commit fe15b50cdeee ("srcu: Allocate per-CPU data for DEFINE_SRCU() in modules") > Signed-off-by: Nick Desaulniers Ah, ignore my earlier question about also fixing this instance. Here it is! ;) Reviewed-by: Kees Cook -Kees > --- > Changes V1->V2: > * drop unrelated Kconfig changes accidentally committed in v1. > > include/linux/srcutree.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/srcutree.h b/include/linux/srcutree.h > index 9cfcc8a756ae..9de652f4e1bd 100644 > --- a/include/linux/srcutree.h > +++ b/include/linux/srcutree.h > @@ -124,7 +124,7 @@ struct srcu_struct { > # define __DEFINE_SRCU(name, is_static) \ > is_static struct srcu_struct name; \ > struct srcu_struct * const __srcu_struct_##name \ > - __section("___srcu_struct_ptrs") = &name > + __section(___srcu_struct_ptrs) = &name > #else > # define __DEFINE_SRCU(name, is_static) \ > static DEFINE_PER_CPU(struct srcu_data, name##_srcu_data); \ > -- > 2.28.0.709.gb0816b6eb0-goog > -- Kees Cook