linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: LEROY Christophe <christophe.leroy@csgroup.eu>
To: Paul Moore <paul@paul-moore.com>
Cc: Eric Paris <eparis@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-audit@redhat.com" <linux-audit@redhat.com>
Subject: RE: [PATCH] audit: Fix build failure by renaming struct node to struct audit_node
Date: Tue, 7 Sep 2021 15:45:47 +0000	[thread overview]
Message-ID: <MRZP264MB29885BAAB4F2D486BB33D201EDD39@MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <CAHC9VhRV06YHwy5cAAiRvOPUGQ9s1LkOdacMAJVzwykD8B_sgA@mail.gmail.com>



> -----Message d'origine-----
> De : Paul Moore <paul@paul-moore.com>
> On Mon, Sep 6, 2021 at 2:41 AM LEROY Christophe
> <christophe.leroy@csgroup.eu> wrote:
> > Le 03/09/2021 à 19:06, Paul Moore a écrit :
> > > On Fri, Sep 3, 2021 at 11:48 AM Christophe Leroy
> > > <christophe.leroy@csgroup.eu> wrote:
> > >>
> > >> struct node defined in kernel/audit_tree.c conflicts with struct
> > >> node defined in include/linux/node.h
> > >>
> > >>            CC      kernel/audit_tree.o
> > >>          kernel/audit_tree.c:33:9: error: redefinition of 'struct node'
> > >>             33 |  struct node {
> > >>                |         ^~~~
> > >>          In file included from ./include/linux/cpu.h:17,
> > >>                           from ./include/linux/static_call.h:102,
> > >>                           from ./arch/powerpc/include/asm/machdep.h:10,
> > >>                           from ./arch/powerpc/include/asm/archrandom.h:7,
> > >>                           from ./include/linux/random.h:121,
> > >>                           from ./include/linux/net.h:18,
> > >>                           from ./include/linux/skbuff.h:26,
> > >>                           from kernel/audit.h:11,
> > >>                           from kernel/audit_tree.c:2:
> > >>          ./include/linux/node.h:84:8: note: originally defined here
> > >>             84 | struct node {
> > >>                |        ^~~~
> > >>          make[2]: *** [kernel/audit_tree.o] Error 1
> > >>
> > >> Rename it audit_node.
> > >>
> > >> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> > >> ---
> > >>   kernel/audit_tree.c | 20 ++++++++++----------
> > >>   1 file changed, 10 insertions(+), 10 deletions(-)
> > >
> > > That's interesting, I wonder why we didn't see this prior?  Also as
> > > an aside, there are evidently a good handful of symbols named
> > > "node".  In fact I don't see this now in the audit/stable-5.15 or
> > > Linus' tree as of a right now, both using an allyesconfig:
> > >
> > > % git show-ref HEAD
> > > a9c9a6f741cdaa2fa9ba24a790db8d07295761e3 refs/remotes/linus/HEAD %
> > > touch kernel/audit_tree.c % make C=1 kernel/
> > >   CALL    scripts/checksyscalls.sh
> > >   CALL    scripts/atomic/check-atomics.sh
> > >   DESCEND objtool
> > >   CHK     kernel/kheaders_data.tar.xz
> > >   CC      kernel/audit_tree.o
> > >   CHECK   kernel/audit_tree.c
> > >   AR      kernel/built-in.a
> > >
> > > What tree and config are you using where you see this error?
> > > Looking at your error, I'm guessing this is limited to ppc builds,
> > > and if I look at the arch/powerpc/include/asm/machdep.h file in
> > > Linus tree I don't see a static_call.h include so I'm guessing this
> > > is a -next tree for ppc?  Something else?
> > >
> > > Without knowing the context, is adding the static_call.h include in
> > > arch/powerpc/include/asm/machdep.h intentional or simply a bit of
> > > include file creep?
> >
> > struct machdep_calls in asm/machdep.h is full of function pointers and
> > I'm working on converting that to static_calls
> > (https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=260878
> > &state=*)
> >
> > So yes, adding static_call.h in asm/machdep.h is intentional and the
> > issue was detected by CI build test
> > (http://kisskb.ellerman.id.au/kisskb/buildresult/14628100/)
> >
> > I submitted this change to you because for me it make sense to not
> > re-use globably defined struct names in local C files, and anybody may
> > encounter the problem as soon as linux/node.h gets included directly
> > or indirectly. But if you prefer I guess the fix may be merged through
> > powerpc tree as part of this series.
>
> Yes, this patch should go in via the audit tree, and while I don't have an
> objection to the patch, whenever I see a patch to fix an issue that is not visible in
> Linus' tree or the audit tree it raises some questions.  I usually hope to see those
> questions answered proactively in the cover letter and/or patch description but
> that wasn't the case here so you get to play a game of 20 questions.
>
> Speaking of which, I don't recall seeing an answer to the "where do these
> include file changes live?" question, is is the ppc -next tree, or are they still
> unmerged and just on the ppc list?
>

It is still an RFC in the ppc list.

Thanks
Christophe

CS Group - Document Interne

  reply	other threads:[~2021-09-07 15:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-03 15:48 [PATCH] audit: Fix build failure by renaming struct node to struct audit_node Christophe Leroy
2021-09-03 17:06 ` Paul Moore
2021-09-06  6:41   ` LEROY Christophe
2021-09-07 15:34     ` Paul Moore
2021-09-07 15:45       ` LEROY Christophe [this message]
2021-09-13 20:19         ` Paul Moore
2021-09-03 18:58 ` Richard Guy Briggs

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=MRZP264MB29885BAAB4F2D486BB33D201EDD39@MRZP264MB2988.FRAP264.PROD.OUTLOOK.COM \
    --to=christophe.leroy@csgroup.eu \
    --cc=eparis@redhat.com \
    --cc=linux-audit@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul@paul-moore.com \
    /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).