Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2275803pxj; Sat, 5 Jun 2021 19:50:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSDygBkwn7cciotQntISrXy9bW2zQxb/PbaXQHU0wwNeehGPVLVAn1tM8ZL/sFZ3PBVn1c X-Received: by 2002:a17:906:b104:: with SMTP id u4mr11520766ejy.211.1622947838143; Sat, 05 Jun 2021 19:50:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622947838; cv=none; d=google.com; s=arc-20160816; b=wTCQ6MmndkflzwhtGgxGUlPZ0yo0T836WeRNPtrfXUASpx4HJ8U+inDmrosJvgosmb SMVtVZc7ksJ08UCx09iSRtCGfLmlEuXuPU6E/mvklltjUc7Tp5b+EbX3RvnIwjU+J0iG wpx8wva3uiWqlDXqV3BHZ4fPOheU5MfrE7PejRVpVJx+kGgJhBF0M4XnOAtbpReE3ZnD AHB0kp588GXSXztkXmrSjc2X3c0Sqhnz9rWbVSaHYf+AyZI+7kdk0FrMHrJ2o6Ir3opR S7eVJhGwbyC8rRCDUZfDV7lhE6xuRgPpZ5Uw2JuYN56JA226NiI11c5yvvJVlOxJ9z2S MiPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=4L84HsDMRengwvFhR659voK60eMx8oWTg2lyl+BZ6GE=; b=GoLEa7ChQj11KHklzAHg0AKfs43WtIDWa+THt/wePhhZfoCEML4zRCyTzWlSZ1Wpl3 6mzjZ5/Pwzgu+aWjXqO36gqNlqx/es6wC6bWv3PA2yCCAwYobyv1eh3XOdZjiv6KB4s4 OgSNdvvDmS3oWAh3eSs9J/DEJI3W/BquBsOj+3V1DvPR32QyMm35uUP7Lat7n5fQbE77 RMHwdXGyRAwCRfFC+lbyLBgH2PPfkBKALB/WMVRIGZWTumaSEklvkwgjZc8UPmNEMxtq GM1AVYEGOAOemWw8mqfqMw9RJvcdXlZox0FpjUg4SOqophcI+VKICj9NRJsC6WA171A0 +eNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=U1sRFJdZ; 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 e1si2770812ejm.185.2021.06.05.19.50.04; Sat, 05 Jun 2021 19:50:38 -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=U1sRFJdZ; 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 S230099AbhFFCmS (ORCPT + 99 others); Sat, 5 Jun 2021 22:42:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230075AbhFFCmR (ORCPT ); Sat, 5 Jun 2021 22:42:17 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72AC8C061766 for ; Sat, 5 Jun 2021 19:40:19 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id c10so20651669eja.11 for ; Sat, 05 Jun 2021 19:40:19 -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; bh=4L84HsDMRengwvFhR659voK60eMx8oWTg2lyl+BZ6GE=; b=U1sRFJdZfGmi+uonE4HR8vlXGoFVNwiVuAJCmpVtbD36Nxuod80lcLMjSVTqKAuiNx V9cTSp8eBVcPqfFvaiOLEbXAknwriuTtHitm8fnubfKye/9oO7KCcakBdty+cRP6WSkp Z1lSj4YMfxi6PHyjGP+7z1wVvutZXxIPrPN0Os8Ewt+n+G8kJzQMHfn9pBzP0ddCfly6 A0V8YkhQxte5oc5ynbAATIoTTVHe0SlV7XDqRvgr1CGZuWFY/O+WpZnLsJGhCYKixldv IJqGPABbt3b1QTJnnLVd6mpMIZ314sAqZU5D3MPJ0j889ID0QeqU3bw8lg8lz7DfqDnr Qe2g== 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; bh=4L84HsDMRengwvFhR659voK60eMx8oWTg2lyl+BZ6GE=; b=dlkuIEhYqFyjdAfONDIvuCvyyuzA8oAjYcnLh6j3xqacjp5wmZWJYmg3K5GCd7fTke cx686jSwWbEx16GRalPP7KWsFZlnWoXPfQvtckEIm4z6kegLeZ5s3asQolAu8kfaS+Tp y09qKqWp5z7L7RVnFzPkx+tbuTzBYX3dPV+YXX71P8/AQBgjXlMSewEc8mXue7/o2g01 uMaKJfLGpexb1DRxGCl+DJCf09flvJobKmDE72uK+HoHgID5hxJFu31VnbZFi7OfYiTq t678ryOuXG99qlsuEJ1J0bVqYETJmEL/kDoKMBjnbER8Jdlo8IV+P7pGAvcUoSLxReAi YmFg== X-Gm-Message-State: AOAM532FLvS+Ce8QNlw/1TBigwsB8dGzR22AOXSdTt4FL8EcFgpGujVg MWUxHOaJkKsimmCnQXqtFPMxa7phbb+WuaTcNFUU X-Received: by 2002:a17:907:2bd6:: with SMTP id gv22mr11413863ejc.431.1622947216905; Sat, 05 Jun 2021 19:40:16 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Paul Moore Date: Sat, 5 Jun 2021 22:40:06 -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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? -- paul moore www.paul-moore.com