2021-10-25 19:45:49

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [PATCH 5.10 70/95] gcc-plugins/structleak: add makefile var for disabling structleak

From: Brendan Higgins <[email protected]>

[ Upstream commit 554afc3b9797511e3245864e32aebeb6abbab1e3 ]

KUnit and structleak don't play nice, so add a makefile variable for
enabling structleak when it complains.

Co-developed-by: Kees Cook <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
Signed-off-by: Brendan Higgins <[email protected]>
Reviewed-by: David Gow <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
scripts/Makefile.gcc-plugins | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/scripts/Makefile.gcc-plugins b/scripts/Makefile.gcc-plugins
index 952e46876329..4aad28480035 100644
--- a/scripts/Makefile.gcc-plugins
+++ b/scripts/Makefile.gcc-plugins
@@ -19,6 +19,10 @@ gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF) \
+= -fplugin-arg-structleak_plugin-byref
gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL) \
+= -fplugin-arg-structleak_plugin-byref-all
+ifdef CONFIG_GCC_PLUGIN_STRUCTLEAK
+ DISABLE_STRUCTLEAK_PLUGIN += -fplugin-arg-structleak_plugin-disable
+endif
+export DISABLE_STRUCTLEAK_PLUGIN
gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK) \
+= -DSTRUCTLEAK_PLUGIN

--
2.33.0




2021-10-25 21:10:20

by Brendan Higgins

[permalink] [raw]
Subject: Re: [PATCH 5.10 70/95] gcc-plugins/structleak: add makefile var for disabling structleak

On Mon, Oct 25, 2021 at 1:56 PM Pavel Machek <[email protected]> wrote:
>
> Hi!
>
> > [ Upstream commit 554afc3b9797511e3245864e32aebeb6abbab1e3 ]
> >
> > KUnit and structleak don't play nice, so add a makefile variable for
> > enabling structleak when it complains.
>
> AFAICT, this patch does nothing useful in 5.10. Unlike mainline,
> DISABLE_STRUCTLEAK_PLUGIN is not used elsewhere in the tree.

The related patches that Greg picked up use this makefile variable.

Cheers

> Best regards,
> Pavel
>
> > +++ b/scripts/Makefile.gcc-plugins
> > @@ -19,6 +19,10 @@ gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF) \
> > += -fplugin-arg-structleak_plugin-byref
> > gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL) \
> > += -fplugin-arg-structleak_plugin-byref-all
> > +ifdef CONFIG_GCC_PLUGIN_STRUCTLEAK
> > + DISABLE_STRUCTLEAK_PLUGIN += -fplugin-arg-structleak_plugin-disable
> > +endif
> > +export DISABLE_STRUCTLEAK_PLUGIN
> > gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK) \
> > += -DSTRUCTLEAK_PLUGIN
> >
> --
> DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

2021-10-26 01:10:43

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH 5.10 70/95] gcc-plugins/structleak: add makefile var for disabling structleak

Hi!

> [ Upstream commit 554afc3b9797511e3245864e32aebeb6abbab1e3 ]
>
> KUnit and structleak don't play nice, so add a makefile variable for
> enabling structleak when it complains.

AFAICT, this patch does nothing useful in 5.10. Unlike mainline,
DISABLE_STRUCTLEAK_PLUGIN is not used elsewhere in the tree.

Best regards,
Pavel

> +++ b/scripts/Makefile.gcc-plugins
> @@ -19,6 +19,10 @@ gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF) \
> += -fplugin-arg-structleak_plugin-byref
> gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL) \
> += -fplugin-arg-structleak_plugin-byref-all
> +ifdef CONFIG_GCC_PLUGIN_STRUCTLEAK
> + DISABLE_STRUCTLEAK_PLUGIN += -fplugin-arg-structleak_plugin-disable
> +endif
> +export DISABLE_STRUCTLEAK_PLUGIN
> gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK) \
> += -DSTRUCTLEAK_PLUGIN
>
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany


Attachments:
(No filename) (1.02 kB)
signature.asc (201.00 B)
Download all attachments

2021-10-26 01:54:08

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH 5.10 70/95] gcc-plugins/structleak: add makefile var for disabling structleak

Hi!

> > > [ Upstream commit 554afc3b9797511e3245864e32aebeb6abbab1e3 ]
> > >
> > > KUnit and structleak don't play nice, so add a makefile variable for
> > > enabling structleak when it complains.
> >
> > AFAICT, this patch does nothing useful in 5.10. Unlike mainline,
> > DISABLE_STRUCTLEAK_PLUGIN is not used elsewhere in the tree.
>
> The related patches that Greg picked up use this makefile variable.

I don't think so, not in 5.10. Can you double-check?

pavel@duo:~/cip/krc$ grep -ri DISABLE_STRUCTLEAK_PLUGIN .
./scripts/Makefile.gcc-plugins: DISABLE_STRUCTLEAK_PLUGIN += -fplugin-arg-structleak_plugin-disable
./scripts/Makefile.gcc-plugins:export DISABLE_STRUCTLEAK_PLUGIN
pavel@duo:~/cip/krc$
commit b67ee9a213819f2c817e3d344c2fc186f299a4f5 (HEAD, origin/queue/5.10)
Author: Fabien Dessenne <[email protected]>
Date: Fri Oct 8 14:25:17 2021 +0200

Best regards,
Pavel
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany


Attachments:
(No filename) (1.05 kB)
signature.asc (201.00 B)
Download all attachments