Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3421650pxj; Mon, 7 Jun 2021 10:10:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlHojv2dLLZmaS4i/Bwxuvw9bs6vdUwepKTy3MZq6k6MIU85GGj+C4mgHvvSSp3DHdwaHH X-Received: by 2002:a17:906:7188:: with SMTP id h8mr18982427ejk.529.1623085836555; Mon, 07 Jun 2021 10:10:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623085836; cv=none; d=google.com; s=arc-20160816; b=vE3L4apYGOulywGB9eFPaDiM8/52/fGoq473M34cWyjXKs2EIO053lkvfejUjvTNuy iehBcm7MVOaDB/7LiwxXahjX2oQJovHNwEemuONxuwDm53Fd40Rc4rpm6sELa+YClKX6 zfCzwCKrMJxpD8jbK0/D/7r2YhL/00rYgSZ5Q84Jwbs44LcWj/6MnBj4Eu2+rS+it3JU Ajc3GgTi7yy06257l3xr6TJ7QUs2o8ooLGbMdSbAR/VQBixrpErtfLSMDi1rip+JnxAs 7V2pg0XbJv7sidPbJmA1JcrRXNcf2t06Zb2FJh9vZqgbC4+mt/JwIMDvlN9LRPDPAArY V0Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=hftge2z/nCvoHEdxWR2iSOrmMyd0wmymVhWiCXlzW+g=; b=Tf3G8/l1hnfvM47OdPrXq60CshkQ8lJYDObBt326DuhIjj+0DYo/8G2JNt5XKJnfc9 GesQt0lj7/KFmvy2kTEujxWyCVJcivyOZt2cbPzn+rJo44T78N2N4Ef3WTidFq+EMaRn bnsMzJf/gxPGUEW1ttW/aOPdqndoL4V0J/zSfBcB0XQqv3KxQqjvTBmJ9kPzIVL6jxV9 I1oZPAieiQLymcE9WygTwuyuF2at4ofFjEGgnmlU9Njaae/+oxXNjXq3xDxHR7J2R7Td ec+dpiMbv7GQlwbjnTrAe8uc5pwf2EIsdi/ARKrK8HhHqHSJL2oJWDmb5Ztax9xikh1P mA2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=bHMz5TGt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e12si10032267ejl.676.2021.06.07.10.10.13; Mon, 07 Jun 2021 10:10:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=bHMz5TGt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230333AbhFGRKN (ORCPT + 99 others); Mon, 7 Jun 2021 13:10:13 -0400 Received: from mail-ej1-f48.google.com ([209.85.218.48]:41642 "EHLO mail-ej1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230242AbhFGRKM (ORCPT ); Mon, 7 Jun 2021 13:10:12 -0400 Received: by mail-ej1-f48.google.com with SMTP id ho18so16905262ejc.8 for ; Mon, 07 Jun 2021 10:08:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=hftge2z/nCvoHEdxWR2iSOrmMyd0wmymVhWiCXlzW+g=; b=bHMz5TGtkKXuxGplLWe+Us5miWu/oHo+rYKagxGRMYVGJeSihqSKNYo7Zt+tPjMzOJ hGNCb/AmeDGwK34ugu1LUKRRqPhTdrHmHXi4jk/jretE3lrDCaANOtSD5u1qWUW8axM0 xgNJobanOYQnSvYl5fi0E3Ut9BLX5JVApxuwsFnrb6Oqz7Pz0so0dBUtGdaovX2Y1IYa c9rS+OSZv6iVelbWbZDsy13zURRv434FmGyFqGyG9d87pIxItfNEEfbUbilNNF4TzxDj TWOg3EhPWNyKsPCk3gTJfC2CQ6dUDqh9BBvk6yne/iCwZTmCGlFMct8Q/mFL8zkcOTTb z4uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=hftge2z/nCvoHEdxWR2iSOrmMyd0wmymVhWiCXlzW+g=; b=LBWWTSYM2egKTBR32DTOlIfPYeTX4SNHwKMci7dvmw/hAn+eAnajUPGAnxFi4mIMMj 6H7mkfAO0947j082s/Eoryq1PcsRZ9bZ705H3UN1/Ek1YGe3nR/VF/PtJEyrV5HmVI5q QrYSpl93bqESG8adX3r2LQfjmfP7J9vaEhK2T38RUq5bj4uFLwkE2LzPoQNS+FMdZu8Y Fdcebn+jYn880FdmTfpzeVJvuiPx3r4LrBUh2x05w0nQy90X5je56yjPvwzluNZS7ytk FP8YG0cO1y/plDc4XHdoOtcW3DFaS66MvOdwPxrPKFIVMg+jXJRBGlU1ydZAZU1PnTmX kQUg== X-Gm-Message-State: AOAM5302RsTFX5iI/OxZ+CguCZpjBPXdetKRmpsqIeXO2SzEWwwBz8Vg wZwPc17mEDYS7y7nHxzVfFOGYyjBJ1I1kXCP2x5Z X-Received: by 2002:a17:907:10d8:: with SMTP id rv24mr18791462ejb.542.1623085640492; Mon, 07 Jun 2021 10:07:20 -0700 (PDT) MIME-Version: 1.0 References: <79d5bffd63b46bb7d54ebcef4765cfca28f76ff0.camel@yandex.ru> In-Reply-To: <79d5bffd63b46bb7d54ebcef4765cfca28f76ff0.camel@yandex.ru> From: Paul Moore Date: Mon, 7 Jun 2021 13:07:09 -0400 Message-ID: Subject: Re: [PATCH] audit: Rename enum audit_state constants to avoid AUDIT_DISABLED redefinition To: Sergey Nazarov Cc: linux-kernel@vger.kernel.org, linux-audit@redhat.com, Eric Paris Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 7, 2021 at 5:58 AM Sergey Nazarov 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. > =D0=92 =D0=A1=D0=B1, 05/06/2021 =D0=B2 22:40 -0400, Paul Moore =D0=BF=D0= =B8=D1=88=D0=B5=D1=82: > > On Fri, Jun 4, 2021 at 7:21 AM Sergey Nazarov > > 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 > > > --- > > > 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? > > > --=20 paul moore www.paul-moore.com