Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp660887iog; Mon, 13 Jun 2022 10:04:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyghxNfmEJKaT2G8FMc+3AVd5CY0Ws7PEM9fysyBDrwEvgSH7L1ptAz+FjrW/PiECpJ8O5N X-Received: by 2002:a17:90b:1d83:b0:1e2:f63e:bc37 with SMTP id pf3-20020a17090b1d8300b001e2f63ebc37mr16648437pjb.119.1655139893863; Mon, 13 Jun 2022 10:04:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655139893; cv=none; d=google.com; s=arc-20160816; b=fjmsqUTRYHBzDB4LWdaljiwEIUXtK3ecKG1qknXwxYbJgE2Wv+lfzHk3SU5mVXraUM JrTWrg6RdWonxp0tK0DGT69BI18TNJr0enNBQZ10QYInm2b9ELBgcqe7rW5Qyi/QtNDE lfHXFK8lL4qiIppQ/4bM/pnXz5VBb7X/HXQUnvv5wqPTJoNbw0EaKWa+NVVOdzv4Bq+3 jz6X4mrzeHncxfgeY+eQUp6O5E0hWBeVD3/0o+jj9gIAj1b5JBuNiYuHEwLamAwm+87u iothGxiSkVIkXUOym1ambL5Z4qf+6wlcvJOjD3/DH/TJvhcPZko/UBiJHY6sMsK92qS5 S0Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YdqRjEZ/d7992URiuPMPxsd3SB8NELfQejFAXR4cbg4=; b=dU881Tpc9vETrfu1ZF0Tydap753PI4O+c/N7rFwJwjKcF/h83pj8IQ8UdfcF1EWAF0 qbH8WMkZXjB+CJ8UQafiipYvHSCT7JHsa9ZR9zo3j6UfsYqkYykxnxsZfe/+NPObBp9y Y4EoXlQ9N55MQAZvnmNqr/Hbv2l0NFLI06l3OOnrlx0ukqTsRJR2bFLg0GIIopGRRA9v suTSPVoPqq6Ec87KzEWY5vL7dOqeUrWulZpAQd8foCPFlpPYYxPGVtey2r+1RCAAgSXa UTzkKSe5muf2hEmAL04piOCVupWDYMKBKwL2oc/lDnxi7nfayKZ5XJ8zsxF6vgIQkA+f 2UIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=t1pa3B5w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e32-20020a630f20000000b003fdf16e7a75si10595985pgl.379.2022.06.13.10.04.39; Mon, 13 Jun 2022 10:04:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=t1pa3B5w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378000AbiFMNg1 (ORCPT + 99 others); Mon, 13 Jun 2022 09:36:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378626AbiFMNbz (ORCPT ); Mon, 13 Jun 2022 09:31:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E098712F1; Mon, 13 Jun 2022 04:26:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DCEB660B6E; Mon, 13 Jun 2022 11:26:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6E61C34114; Mon, 13 Jun 2022 11:26:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655119584; bh=RAPHGV+rtvwWQJEXunWfr637QO4/abkhlqk7qVnMv14=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t1pa3B5w2bBQIrAUIqWsfuEGOOiNOFoucrc9iHbArcmMMmsrapZMPgS3SYIipoOtj 8+HdDyLtmOwjXb8hTsyOSmqd2jz64l/494kOqfQwjGbNhZIes6fFsCjOBwbCna7UPY W6gWHQ56X8RikGaYaYAde8cuQbMIVe/bcGx+SIvg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miroslav Benes , Emil Velikov , Jessica Yu , Quentin Perret , Matthias Maennich , Masahiro Yamada , Sasha Levin Subject: [PATCH 5.18 046/339] export: fix string handling of namespace in EXPORT_SYMBOL_NS Date: Mon, 13 Jun 2022 12:07:51 +0200 Message-Id: <20220613094927.920126897@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094926.497929857@linuxfoundation.org> References: <20220613094926.497929857@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman [ Upstream commit d143b9db8069f0e2a0fa34484e806a55a0dd4855 ] Commit c3a6cf19e695 ("export: avoid code duplication in include/linux/export.h") broke the ability for a defined string to be used as a namespace value. Fix this up by using stringify to properly encode the namespace name. Fixes: c3a6cf19e695 ("export: avoid code duplication in include/linux/export.h") Cc: Miroslav Benes Cc: Emil Velikov Cc: Jessica Yu Cc: Quentin Perret Cc: Matthias Maennich Reviewed-by: Masahiro Yamada Link: https://lore.kernel.org/r/20220427090442.2105905-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- include/linux/export.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/linux/export.h b/include/linux/export.h index 27d848712b90..5910ccb66ca2 100644 --- a/include/linux/export.h +++ b/include/linux/export.h @@ -2,6 +2,8 @@ #ifndef _LINUX_EXPORT_H #define _LINUX_EXPORT_H +#include + /* * Export symbols from the kernel to modules. Forked from module.h * to reduce the amount of pointless cruft we feed to gcc when only @@ -154,7 +156,6 @@ struct kernel_symbol { #endif /* CONFIG_MODULES */ #ifdef DEFAULT_SYMBOL_NAMESPACE -#include #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, __stringify(DEFAULT_SYMBOL_NAMESPACE)) #else #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "") @@ -162,8 +163,8 @@ struct kernel_symbol { #define EXPORT_SYMBOL(sym) _EXPORT_SYMBOL(sym, "") #define EXPORT_SYMBOL_GPL(sym) _EXPORT_SYMBOL(sym, "_gpl") -#define EXPORT_SYMBOL_NS(sym, ns) __EXPORT_SYMBOL(sym, "", #ns) -#define EXPORT_SYMBOL_NS_GPL(sym, ns) __EXPORT_SYMBOL(sym, "_gpl", #ns) +#define EXPORT_SYMBOL_NS(sym, ns) __EXPORT_SYMBOL(sym, "", __stringify(ns)) +#define EXPORT_SYMBOL_NS_GPL(sym, ns) __EXPORT_SYMBOL(sym, "_gpl", __stringify(ns)) #endif /* !__ASSEMBLY__ */ -- 2.35.1