From: Paul Moore <paul@paul-moore.com> To: Sergey Nazarov <s-nazarov@yandex.ru> Cc: linux-kernel@vger.kernel.org, linux-audit@redhat.com, Eric Paris <eparis@redhat.com> Subject: Re: [PATCH] audit: Rename enum audit_state constants to avoid AUDIT_DISABLED redefinition Date: Mon, 7 Jun 2021 13:07:09 -0400 [thread overview] Message-ID: <CAHC9VhQfzx6xhZz+ghkRB2UKWHmsHKjLzz_7z3L47GHOoHLchw@mail.gmail.com> (raw) In-Reply-To: <79d5bffd63b46bb7d54ebcef4765cfca28f76ff0.camel@yandex.ru> On Mon, Jun 7, 2021 at 5:58 AM Sergey Nazarov <s-nazarov@yandex.ru> wrote: > Hi, Paul! > I think this could be easer. It's enouth to rename AUDIT_DISABLE only. > enum audit_state deals with per-task syscalls audit context, so we can > use AUDIT_CONTEXT_DISABLED for example. If it's okay, I can send a new > patch version. Hi Sergey, I personally prefer the AUDIT_STATE_* enums and would rather see that. > В Сб, 05/06/2021 в 22:40 -0400, Paul Moore пишет: > > On Fri, Jun 4, 2021 at 7:21 AM Sergey Nazarov <s-nazarov@yandex.ru> > > wrote: > > > > > > AUDIT_DISABLED defined in kernel/audit.h as element of enum > > > audit_state > > > and redefined in kernel/audit.c. This produces a warning when > > > kernel builds > > > with syscalls audit disabled and brokes kernel build if -Werror > > > used. > > > enum audit_state used in syscall audit code only. This patch > > > changes > > > enum audit_state constants prefix AUDIT to AUDITSC to avoid > > > AUDIT_DISABLED > > > redefinition. > > > > > > Signed-off-by: Sergey Nazarov <s-nazarov@yandex.ru> > > > --- > > > kernel/audit.h | 8 ++++---- > > > kernel/auditsc.c | 34 +++++++++++++++++----------------- > > > 2 files changed, 21 insertions(+), 21 deletions(-) > > > > Hi Sergey, > > > > Thanks for sending a patch to fix this problem. One comment below > > ... > > > > > diff --git a/kernel/audit.h b/kernel/audit.h > > > index 1522e10..ee81f20 100644 > > > --- a/kernel/audit.h > > > +++ b/kernel/audit.h > > > @@ -21,16 +21,16 @@ > > > a per-task filter. At syscall entry, the audit_state is > > > augmented by > > > the syscall filter. */ > > > enum audit_state { > > > - AUDIT_DISABLED, /* Do not create per-task > > > audit_context. > > > + AUDITSC_DISABLED, /* Do not create per-task > > > audit_context. > > > * No syscall-specific audit > > > records can > > > * be generated. */ > > > - AUDIT_BUILD_CONTEXT, /* Create the per-task > > > audit_context, > > > + AUDITSC_BUILD_CONTEXT, /* Create the per-task > > > audit_context, > > > * and fill it in at syscall > > > * entry time. This makes a full > > > * syscall record available if some > > > * other part of the kernel decides > > > it > > > * should be recorded. */ > > > - AUDIT_RECORD_CONTEXT /* Create the per-task > > > audit_context, > > > + AUDITSC_RECORD_CONTEXT /* Create the per-task > > > audit_context, > > > * always fill it in at syscall > > > entry > > > * time, and always write out the > > > audit > > > * record at syscall exit time. */ > > > > I believe that just as the AUDIT_ prefix proved to be a bit too > > generic, I think that the AUDITSC_ prefix is also not the best > > choice. > > Would you object to using the AUDIT_STATE_ prefix? As that may get a > > bit long, I might suggest dropping the _CONTEXT from the enums too > > such that you would end up with the following: > > > > enum audit_state { > > AUDIT_STATE_DISABLED, > > AUDIT_STATE_BUILD, > > AUDIT_STATE_RECORD, > > }; > > > > Thoughts? > > > -- paul moore www.paul-moore.com
WARNING: multiple messages have this Message-ID (diff)
From: Paul Moore <paul@paul-moore.com> To: Sergey Nazarov <s-nazarov@yandex.ru> Cc: linux-audit@redhat.com, linux-kernel@vger.kernel.org, Eric Paris <eparis@redhat.com> Subject: Re: [PATCH] audit: Rename enum audit_state constants to avoid AUDIT_DISABLED redefinition Date: Mon, 7 Jun 2021 13:07:09 -0400 [thread overview] Message-ID: <CAHC9VhQfzx6xhZz+ghkRB2UKWHmsHKjLzz_7z3L47GHOoHLchw@mail.gmail.com> (raw) In-Reply-To: <79d5bffd63b46bb7d54ebcef4765cfca28f76ff0.camel@yandex.ru> On Mon, Jun 7, 2021 at 5:58 AM Sergey Nazarov <s-nazarov@yandex.ru> wrote: > Hi, Paul! > I think this could be easer. It's enouth to rename AUDIT_DISABLE only. > enum audit_state deals with per-task syscalls audit context, so we can > use AUDIT_CONTEXT_DISABLED for example. If it's okay, I can send a new > patch version. Hi Sergey, I personally prefer the AUDIT_STATE_* enums and would rather see that. > В Сб, 05/06/2021 в 22:40 -0400, Paul Moore пишет: > > On Fri, Jun 4, 2021 at 7:21 AM Sergey Nazarov <s-nazarov@yandex.ru> > > wrote: > > > > > > AUDIT_DISABLED defined in kernel/audit.h as element of enum > > > audit_state > > > and redefined in kernel/audit.c. This produces a warning when > > > kernel builds > > > with syscalls audit disabled and brokes kernel build if -Werror > > > used. > > > enum audit_state used in syscall audit code only. This patch > > > changes > > > enum audit_state constants prefix AUDIT to AUDITSC to avoid > > > AUDIT_DISABLED > > > redefinition. > > > > > > Signed-off-by: Sergey Nazarov <s-nazarov@yandex.ru> > > > --- > > > kernel/audit.h | 8 ++++---- > > > kernel/auditsc.c | 34 +++++++++++++++++----------------- > > > 2 files changed, 21 insertions(+), 21 deletions(-) > > > > Hi Sergey, > > > > Thanks for sending a patch to fix this problem. One comment below > > ... > > > > > diff --git a/kernel/audit.h b/kernel/audit.h > > > index 1522e10..ee81f20 100644 > > > --- a/kernel/audit.h > > > +++ b/kernel/audit.h > > > @@ -21,16 +21,16 @@ > > > a per-task filter. At syscall entry, the audit_state is > > > augmented by > > > the syscall filter. */ > > > enum audit_state { > > > - AUDIT_DISABLED, /* Do not create per-task > > > audit_context. > > > + AUDITSC_DISABLED, /* Do not create per-task > > > audit_context. > > > * No syscall-specific audit > > > records can > > > * be generated. */ > > > - AUDIT_BUILD_CONTEXT, /* Create the per-task > > > audit_context, > > > + AUDITSC_BUILD_CONTEXT, /* Create the per-task > > > audit_context, > > > * and fill it in at syscall > > > * entry time. This makes a full > > > * syscall record available if some > > > * other part of the kernel decides > > > it > > > * should be recorded. */ > > > - AUDIT_RECORD_CONTEXT /* Create the per-task > > > audit_context, > > > + AUDITSC_RECORD_CONTEXT /* Create the per-task > > > audit_context, > > > * always fill it in at syscall > > > entry > > > * time, and always write out the > > > audit > > > * record at syscall exit time. */ > > > > I believe that just as the AUDIT_ prefix proved to be a bit too > > generic, I think that the AUDITSC_ prefix is also not the best > > choice. > > Would you object to using the AUDIT_STATE_ prefix? As that may get a > > bit long, I might suggest dropping the _CONTEXT from the enums too > > such that you would end up with the following: > > > > enum audit_state { > > AUDIT_STATE_DISABLED, > > AUDIT_STATE_BUILD, > > AUDIT_STATE_RECORD, > > }; > > > > Thoughts? > > > -- paul moore www.paul-moore.com -- Linux-audit mailing list Linux-audit@redhat.com https://listman.redhat.com/mailman/listinfo/linux-audit
next prev parent reply other threads:[~2021-06-07 17:08 UTC|newest] Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-06-04 11:21 [PATCH] audit: Rename enum audit_state constants to avoid AUDIT_DISABLED redefinition Sergey Nazarov 2021-06-04 11:21 ` Sergey Nazarov 2021-06-04 16:17 ` Richard Guy Briggs 2021-06-04 16:17 ` Richard Guy Briggs 2021-06-06 2:40 ` Paul Moore 2021-06-06 2:40 ` Paul Moore 2021-06-07 9:58 ` Sergey Nazarov 2021-06-07 9:58 ` Sergey Nazarov 2021-06-07 17:07 ` Paul Moore [this message] 2021-06-07 17:07 ` Paul Moore 2021-06-07 17:50 ` Richard Guy Briggs 2021-06-07 17:50 ` Richard Guy Briggs 2021-06-07 18:18 ` Paul Moore 2021-06-07 18:18 ` Paul Moore 2021-06-08 6:32 ` [PATCH v2] " Sergey Nazarov 2021-06-08 6:32 ` Sergey Nazarov 2021-06-08 15:04 ` Richard Guy Briggs 2021-06-08 15:04 ` Richard Guy Briggs 2021-06-09 2:12 ` Paul Moore 2021-06-09 2:12 ` Paul Moore
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=CAHC9VhQfzx6xhZz+ghkRB2UKWHmsHKjLzz_7z3L47GHOoHLchw@mail.gmail.com \ --to=paul@paul-moore.com \ --cc=eparis@redhat.com \ --cc=linux-audit@redhat.com \ --cc=linux-kernel@vger.kernel.org \ --cc=s-nazarov@yandex.ru \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.