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=-6.9 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 C2E54C2D0DC for ; Tue, 31 Dec 2019 19:59:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9D5FB2053B for ; Tue, 31 Dec 2019 19:59:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Qwbo0ZAD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727297AbfLaT7j (ORCPT ); Tue, 31 Dec 2019 14:59:39 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:51668 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727275AbfLaT7j (ORCPT ); Tue, 31 Dec 2019 14:59:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1577822378; 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=Gh8vS5EoSczZMOZV0R4iZJideZTPM4LGa8KkWd+4wzk=; b=Qwbo0ZADT/JGUmzkazTT2WC4J6YaP+qJLUrIl3bIugEPvb6KUFc17GaDf/46hHdQXdBwhd C0lvehUJt+jcwYxkutJFaOL4OO3LYE9Kq2QQka3y/8QzptIW/COSuTx4FFEn1aZ2naGcWb 4R8erazaRcsWZ/aT78siRbcknYPXqa0= 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-57-iWpXP3WKMzOBAN4qD_V9nA-1; Tue, 31 Dec 2019 14:59:36 -0500 X-MC-Unique: iWpXP3WKMzOBAN4qD_V9nA-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 9BA43801E7E; Tue, 31 Dec 2019 19:59:35 +0000 (UTC) Received: from madcap2.tricolour.ca (ovpn-112-15.phx2.redhat.com [10.3.112.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id 584E460BEC; Tue, 31 Dec 2019 19:59:28 +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 v8 09/14] contid: interpret correctly CONTAINER_ID contid field csv Date: Tue, 31 Dec 2019 14:58:16 -0500 Message-Id: <1577822301-19760-10-git-send-email-rgb@redhat.com> In-Reply-To: <1577822301-19760-1-git-send-email-rgb@redhat.com> References: <1577822301-19760-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..82fa9579f972 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 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