linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Kees Cook <keescook@chromium.org>
Cc: Alexander Popov <alex.popov@linux.com>,
	linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] gcc-plugins: Change all version strings match kernel
Date: Mon, 23 May 2022 07:30:54 -0700	[thread overview]
Message-ID: <20220523143054.GA3164771@roeck-us.net> (raw)
In-Reply-To: <20220510235412.3627034-1-keescook@chromium.org>

On Tue, May 10, 2022 at 04:54:12PM -0700, Kees Cook wrote:
> It's not meaningful for the GCC plugins to track their versions separately
> from the rest of the kernel. Switch all versions to the kernel version.
> 
> Fix mismatched indenting while we're at it.
> 
> Cc: linux-hardening@vger.kernel.org
> Signed-off-by: Kees Cook <keescook@chromium.org>

I see random build failures with this patch in linux-next.

Error log:
cc1plus: fatal error: ./include/generated/utsrelease.h: No such file or directory

The problem doesn't happen all the time. Is there some missing dependency ?

Guenter

> ---
>  scripts/gcc-plugins/Makefile                  | 9 +++++----
>  scripts/gcc-plugins/latent_entropy_plugin.c   | 2 +-
>  scripts/gcc-plugins/randomize_layout_plugin.c | 2 +-
>  scripts/gcc-plugins/sancov_plugin.c           | 2 +-
>  scripts/gcc-plugins/stackleak_plugin.c        | 2 +-
>  scripts/gcc-plugins/structleak_plugin.c       | 2 +-
>  6 files changed, 10 insertions(+), 9 deletions(-)
> 
> diff --git a/scripts/gcc-plugins/Makefile b/scripts/gcc-plugins/Makefile
> index 148f4639cf09..6f0aecad5d67 100644
> --- a/scripts/gcc-plugins/Makefile
> +++ b/scripts/gcc-plugins/Makefile
> @@ -28,10 +28,11 @@ GCC_PLUGINS_DIR = $(shell $(CC) -print-file-name=plugin)
>  
>  plugin_cxxflags	= -Wp,-MMD,$(depfile) $(KBUILD_HOSTCXXFLAGS) -fPIC \
>  		  -include $(srctree)/include/linux/compiler-version.h \
> -		   -I $(GCC_PLUGINS_DIR)/include -I $(obj) -std=gnu++11 \
> -		   -fno-rtti -fno-exceptions -fasynchronous-unwind-tables \
> -		   -ggdb -Wno-narrowing -Wno-unused-variable \
> -		   -Wno-format-diag
> +		  -include $(objtree)/include/generated/utsrelease.h \
> +		  -I $(GCC_PLUGINS_DIR)/include -I $(obj) -std=gnu++11 \
> +		  -fno-rtti -fno-exceptions -fasynchronous-unwind-tables \
> +		  -ggdb -Wno-narrowing -Wno-unused-variable \
> +		  -Wno-format-diag
>  
>  plugin_ldflags	= -shared
>  
> diff --git a/scripts/gcc-plugins/latent_entropy_plugin.c b/scripts/gcc-plugins/latent_entropy_plugin.c
> index 8425da41de0d..5d415b2572a8 100644
> --- a/scripts/gcc-plugins/latent_entropy_plugin.c
> +++ b/scripts/gcc-plugins/latent_entropy_plugin.c
> @@ -82,7 +82,7 @@ __visible int plugin_is_GPL_compatible;
>  static GTY(()) tree latent_entropy_decl;
>  
>  static struct plugin_info latent_entropy_plugin_info = {
> -	.version	= "201606141920vanilla",
> +	.version	= UTS_RELEASE,
>  	.help		= "disable\tturn off latent entropy instrumentation\n",
>  };
>  
> diff --git a/scripts/gcc-plugins/randomize_layout_plugin.c b/scripts/gcc-plugins/randomize_layout_plugin.c
> index 65aee5d6d91e..ea2aea570404 100644
> --- a/scripts/gcc-plugins/randomize_layout_plugin.c
> +++ b/scripts/gcc-plugins/randomize_layout_plugin.c
> @@ -34,7 +34,7 @@ __visible int plugin_is_GPL_compatible;
>  static int performance_mode;
>  
>  static struct plugin_info randomize_layout_plugin_info = {
> -	.version	= "201402201816vanilla",
> +	.version	= UTS_RELEASE,
>  	.help		= "disable\t\t\tdo not activate plugin\n"
>  			  "performance-mode\tenable cacheline-aware layout randomization\n"
>  };
> diff --git a/scripts/gcc-plugins/sancov_plugin.c b/scripts/gcc-plugins/sancov_plugin.c
> index 23bd023a283b..f3d629555b84 100644
> --- a/scripts/gcc-plugins/sancov_plugin.c
> +++ b/scripts/gcc-plugins/sancov_plugin.c
> @@ -26,7 +26,7 @@ __visible int plugin_is_GPL_compatible;
>  tree sancov_fndecl;
>  
>  static struct plugin_info sancov_plugin_info = {
> -	.version	= "20160402",
> +	.version	= UTS_RELEASE,
>  	.help		= "sancov plugin\n",
>  };
>  
> diff --git a/scripts/gcc-plugins/stackleak_plugin.c b/scripts/gcc-plugins/stackleak_plugin.c
> index 42f0252ee2a4..de817d54b8af 100644
> --- a/scripts/gcc-plugins/stackleak_plugin.c
> +++ b/scripts/gcc-plugins/stackleak_plugin.c
> @@ -44,7 +44,7 @@ static bool verbose = false;
>  static GTY(()) tree track_function_decl;
>  
>  static struct plugin_info stackleak_plugin_info = {
> -	.version = "201707101337",
> +	.version = UTS_RELEASE,
>  	.help = "track-min-size=nn\ttrack stack for functions with a stack frame size >= nn bytes\n"
>  		"arch=target_arch\tspecify target build arch\n"
>  		"disable\t\tdo not activate the plugin\n"
> diff --git a/scripts/gcc-plugins/structleak_plugin.c b/scripts/gcc-plugins/structleak_plugin.c
> index 74e319288389..86b608a24ec0 100644
> --- a/scripts/gcc-plugins/structleak_plugin.c
> +++ b/scripts/gcc-plugins/structleak_plugin.c
> @@ -37,7 +37,7 @@
>  __visible int plugin_is_GPL_compatible;
>  
>  static struct plugin_info structleak_plugin_info = {
> -	.version	= "20190125vanilla",
> +	.version	= UTS_RELEASE,
>  	.help		= "disable\tdo not activate plugin\n"
>  			  "byref\tinit structs passed by reference\n"
>  			  "byref-all\tinit anything passed by reference\n"
> -- 
> 2.32.0
> 

  parent reply	other threads:[~2022-05-23 14:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-10 23:54 [PATCH] gcc-plugins: Change all version strings match kernel Kees Cook
2022-05-11  7:31 ` kernel test robot
2022-05-23 14:30 ` Guenter Roeck [this message]
2022-05-23 19:28   ` Kees Cook
2022-05-23 19:56     ` Guenter Roeck
2022-05-23 19:54   ` Kees Cook
2022-05-25 22:42     ` Anders Roxell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220523143054.GA3164771@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=alex.popov@linux.com \
    --cc=keescook@chromium.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).