Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp582921pxa; Thu, 27 Aug 2020 10:02:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlRSC/LGVKz6PIIMvbSOOJ0bPOe/l95VXqQvo5tikhyl97nGPJ9wDgUMfvIk1Da4iyT1Ki X-Received: by 2002:a17:906:1b04:: with SMTP id o4mr23287839ejg.332.1598547754688; Thu, 27 Aug 2020 10:02:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598547754; cv=none; d=google.com; s=arc-20160816; b=Uv6K33767A4OLM6G+FBIwZBrTj3ep49f0j0pYsIWeXtSxg2ixjp35LjEttlSZ94WaP PdIkwg5GDMdD1M52fV8f1G6rxeHEqaYcrNxs5nOdHS8/cui9GFwS0kSMD1Kjacbf5AuH 5FS4rsd+j37Qe4vZ86Sn5uSvn+bRKnLKWwi6hukEFd5Oal0fvm6scNztKr8gPzH0jsmD R1mynUWZ7VECaz/KZdphNKf9TEI6SVGDlo4jhwNo4Er6CYksmyB5OxMykuzu9bhZDMV9 6pPUTwgB4qClYsDCZKw4XBzw5RAEAzI2w3BSFlvoVRN1E38ImqzcDSSnQNMVj2Jd8Sfh CxkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=fQwOilPKk1piCWiUYQqWKm3Q131dR9gCFRx5y6SMd7w=; b=vDx9/jrB7VbxOhggIAhrcfZ+vYzDd2YsuLIXzZq4uIV2P7fcl3/SzPHoteupPLACac kPLA4GkTlFlD0+v3URAP/JWLsPFSFPHvI04V0OYWUx3H8BD80Kj67xI2nMMmMeGHjHuc nhMa6yLcZQEy46JW6+t5imERyQOAn+cyfHlL5IeWUtP4XFLZL8aOXJDEOLGBkWVKdLs+ XQokkLFB/YjCb52HHJhf0uK7ASV6DrCgvF+01IStHOvNvaUEI38J0xzIGK4QzzfY3CWV q89uzQzpLVGmcvOlFejODnBAdNyWDO+/jdb1y+vWNXRZOcYD+8sFlZcOm8zcDxvfSJ0H LePw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=GU3t6tHO; 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 sb29si1801490ejb.43.2020.08.27.10.02.10; Thu, 27 Aug 2020 10:02:34 -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=GU3t6tHO; 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 S1727084AbgH0RBS (ORCPT + 99 others); Thu, 27 Aug 2020 13:01:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727034AbgH0RBN (ORCPT ); Thu, 27 Aug 2020 13:01:13 -0400 Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 020E6C061232 for ; Thu, 27 Aug 2020 10:01:11 -0700 (PDT) Received: by mail-ed1-x544.google.com with SMTP id q21so4352011edv.1 for ; Thu, 27 Aug 2020 10:01:11 -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=fQwOilPKk1piCWiUYQqWKm3Q131dR9gCFRx5y6SMd7w=; b=GU3t6tHOHu2MtrVfx2sMpm5WdOuJxuu031alP5ivhrqq5P/pHwXExArOYO1KsWT1zq cknfojUCR6Td7kJzSIn9s0J9UNU9ulNJAEND9jG1v+PM4tggjg8yvlV75OPhB6poYwdK Tw++wzZ8I+mv/1wE3GebYJI9JPQCN4kZRRybwkHw+YvFkbI6PlDBeLJ/EMFKsRf5xcwE ZHjSHjEqZqJHgROwJw0gbYCNAQvpc1qZQ5gpgnXfw7rXC7vTsoQK9lQyrNcoNt4c8L9b Tdm/sGZlAGt0i45FRWvywm9vWtnyllycLoBpUyjmUXSbnlwbFYnJmFPomt9dRQ+sPkFR e2mg== 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=fQwOilPKk1piCWiUYQqWKm3Q131dR9gCFRx5y6SMd7w=; b=JK64fK/c+SbMjY1/cbs8OmDgeJFTa9+tOI0IYoOiQqdrQWZoVmaP61BIqb5Dlp72D+ ef7vtPDiJy0s/RYGjtAx6Y7XrLHEzAaA07NWiLMu+Q+lhDWw6XyOP+VlLag5gb79gKrf EignT5+/t8HOsril/uJuFHssX5f7SdFSrh/iklTFuykuUF+Eft1gh5UsaFf9YyRqJO9r m82rGrwZEyUcDdzYxGjNlocXPu9+RDWlq3Bceq3You7sSJI++sXVUn2b/VOT8RiMXsGW aBKeG/FpXiktoOw2u9Pa8hs66+ng+nfUAlD0NUR2LyCO1obJystpLGz+6ax5U1EWz0UG PiMA== X-Gm-Message-State: AOAM533VOUeyjmLv1Y8ZLBDywm5wZefUzIjah2gkQk9QkWINzkgIZdRi UXD5Sr7QB7hckjkrOq0mi1aZkGbnTmpQNw3lBdoH X-Received: by 2002:aa7:ca46:: with SMTP id j6mr18609335edt.128.1598547670264; Thu, 27 Aug 2020 10:01:10 -0700 (PDT) MIME-Version: 1.0 References: <20200827163712.106303-1-alex.dewar90@gmail.com> In-Reply-To: <20200827163712.106303-1-alex.dewar90@gmail.com> From: Paul Moore Date: Thu, 27 Aug 2020 13:00:58 -0400 Message-ID: Subject: Re: [PATCH RFC] netlabel: remove unused param from audit_log_format() To: Alex Dewar Cc: "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 27, 2020 at 12:39 PM Alex Dewar wrote: > > Commit d3b990b7f327 ("netlabel: fix problems with mapping removal") > added a check to return an error if ret_val != 0, before ret_val is > later used in a log message. Now it will unconditionally print "... > res=0". So don't print res anymore. > > Addresses-Coverity: ("Dead code") > Fixes: d3b990b7f327 ("netlabel: fix problems with mapping removal") > Signed-off-by: Alex Dewar > --- > > I wasn't sure whether it was intended that something other than ret_val > be printed in the log, so that's why I'm sending this as an RFC. It's intentional for a couple of reasons: * The people who care about audit logs like to see success/fail (e.g. "res=X") for audit events/records, so printing this out gives them the warm fuzzies. * For a lot of awful reasons that I won't bore you with, we really don't want to add/remove fields in the middle of an audit record so we pretty much need to keep the "res=0" there even if it seems a bit redundant. So NACK from me, but thanks for paying attention just the same :) > net/netlabel/netlabel_domainhash.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/net/netlabel/netlabel_domainhash.c b/net/netlabel/netlabel_domainhash.c > index f73a8382c275..526762b2f3a9 100644 > --- a/net/netlabel/netlabel_domainhash.c > +++ b/net/netlabel/netlabel_domainhash.c > @@ -612,9 +612,8 @@ int netlbl_domhsh_remove_entry(struct netlbl_dom_map *entry, > audit_buf = netlbl_audit_start_common(AUDIT_MAC_MAP_DEL, audit_info); > if (audit_buf != NULL) { > audit_log_format(audit_buf, > - " nlbl_domain=%s res=%u", > - entry->domain ? entry->domain : "(default)", > - ret_val == 0 ? 1 : 0); > + " nlbl_domain=%s", > + entry->domain ? entry->domain : "(default)"); > audit_log_end(audit_buf); > } > -- paul moore www.paul-moore.com