lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 5 Jun 2021 22:40:06 -0400
From:   Paul Moore <paul@...l-moore.com>
To:     Sergey Nazarov <s-nazarov@...dex.ru>
Cc:     linux-kernel@...r.kernel.org, linux-audit@...hat.com,
        Eric Paris <eparis@...hat.com>
Subject: Re: [PATCH] audit: Rename enum audit_state constants to avoid
 AUDIT_DISABLED redefinition

On Fri, Jun 4, 2021 at 7:21 AM Sergey Nazarov <s-nazarov@...dex.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@...dex.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ