From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03C72C433E0 for ; Sat, 27 Jun 2020 15:19:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B7E072184D for ; Sat, 27 Jun 2020 15:19:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="du7qg+Sb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726905AbgF0PTt (ORCPT ); Sat, 27 Jun 2020 11:19:49 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:26650 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725932AbgF0PTp (ORCPT ); Sat, 27 Jun 2020 11:19:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593271184; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=H1Fmk+KrQbw/drHzofYm7uGD2Cp5VL08+8hihfA8NDw=; b=du7qg+SbnsGfFXIZ51X+u7u90UERn4rOsM2X7MK1kNDfwJmIZVEADPPZSO0I2clkjtyD8o FnFDKlN+X3OLA9tQcBIax1M9t7r7nMcnNzJev/PtHqudmG+LEXdeNclM1sXouwnADEmkg7 ur16rawUF5af8sqLjYM2xprkmEUnbRc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-489-0mnSlGRwPmyMJIpfGwczeA-1; Sat, 27 Jun 2020 11:19:41 -0400 X-MC-Unique: 0mnSlGRwPmyMJIpfGwczeA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B51F31005512; Sat, 27 Jun 2020 15:19:38 +0000 (UTC) Received: from madcap2.tricolour.ca (unknown [10.10.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id A775160BF4; Sat, 27 Jun 2020 15:19:35 +0000 (UTC) From: Richard Guy Briggs To: containers@lists.linux-foundation.org, Linux-Audit Mailing List , LKML Cc: eparis@parisplace.org, Steve Grubb , omosnace@redhat.com, Paul Moore , nhorman@redhat.com, dwalsh@redhat.com, mpatel@redhat.com, Richard Guy Briggs Subject: [PATCH ghau51/ghau40 v9 09/11] contid: interpret correctly CONTAINER_ID contid field csv Date: Sat, 27 Jun 2020 11:18:09 -0400 Message-Id: <1593271091-30188-10-git-send-email-rgb@redhat.com> In-Reply-To: <1593271091-30188-1-git-send-email-rgb@redhat.com> References: <1593271091-30188-1-git-send-email-rgb@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The CONTAINER_ID record contid field can contain comma-separated values when accompanying a NETFILTER_PKT record. Records appeared interpreted as such: Wrong: CONTAINER_ID msg=audit(2019-04-10 13:20:18.746:1690) : contid=777 666,333 Right: CONTAINER_ID msg=audit(2019-04-10 13:20:18.746:1690) : contid=777,666,333 Signed-off-by: Richard Guy Briggs --- src/ausearch-report.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ausearch-report.c b/src/ausearch-report.c index 416c2b13fa6a..754b28af2cb6 100644 --- a/src/ausearch-report.c +++ b/src/ausearch-report.c @@ -279,7 +279,7 @@ no_print: if (str && val && (str < val)) { // Value side has commas and another field exists // Known: LABEL_LEVEL_CHANGE banners=none,none - // Known: ROLL_ASSIGN new-role=r,r + // Known: ROLE_ASSIGN new-role=r,r // Known: any MAC LABEL can potentially have commas int ftype = auparse_interp_adjust_type(n->type, name, val); @@ -293,9 +293,11 @@ no_print: } else if (str && (val == NULL)) { // Goes all the way to the end. Done parsing // Known: MCS context in PATH rec obj=u:r:t:s0:c2,c7 + // Known: CONTAINER_ID/OP old-/contid can be a comma-separated list int ftype = auparse_interp_adjust_type(n->type, name, ptr); - if (ftype == AUPARSE_TYPE_MAC_LABEL) + if (ftype == AUPARSE_TYPE_MAC_LABEL + || ftype == AUPARSE_TYPE_CONTID) str = NULL; else { *str++ = 0; -- 1.8.3.1