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=-11.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,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 BC63CC433DF for ; Tue, 16 Jun 2020 12:06:55 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6BF3B2074D for ; Tue, 16 Jun 2020 12:06:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="XUxVjF+l" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6BF3B2074D Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-audit-bounces@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592309214; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=vN3Fv7h8MGhFmflDgSzCSDd6KIhTHAWtyGsn7c9qK9A=; b=XUxVjF+l4VF35yORzQY5i/k5zv4VgsMy51PBNIUpzrQWT3D29dGxrh7QH9R1S1HNV3xu2h ByfhQKdp+NmZ6als6cytg7lWVbyky0j7LIQ78l+QcTiKtcY5uVmiHMwYrA9FGtBbs9TOW+ lpRuzkO8ZpmBVuotvHhpqB5DcDXWpPo= 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-497-g9lXVDnlPUOmhgCQqVl8EA-1; Tue, 16 Jun 2020 08:06:52 -0400 X-MC-Unique: g9lXVDnlPUOmhgCQqVl8EA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 39DF3803312; Tue, 16 Jun 2020 12:06:48 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8C3F95C1BD; Tue, 16 Jun 2020 12:06:46 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1214887422; Tue, 16 Jun 2020 12:06:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05GC6axC001017 for ; Tue, 16 Jun 2020 08:06:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3F2D479301; Tue, 16 Jun 2020 12:06:36 +0000 (UTC) Received: from madcap2.tricolour.ca (unknown [10.10.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 29FB890334; Tue, 16 Jun 2020 12:06:25 +0000 (UTC) From: Richard Guy Briggs To: Linux-Audit Mailing List Subject: [PATCH ghau86] allow LOGIN event record to be grouped with its SYSCALL record Date: Tue, 16 Jun 2020 08:05:50 -0400 Message-Id: <1592309150-11920-1-git-send-email-rgb@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: linux-audit@redhat.com Cc: Richard Guy Briggs , eparis@parisplace.org X-BeenThere: linux-audit@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Linux Audit Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit LOGIN records were not grouped with the rest of their event, records with the identical timestamp and serial number: ---- time->Tue Mar 19 12:23:15 2019 type=LOGIN msg=audit(1553012595.401:219): pid=647 uid=0 subj=system_u:system_r:local_login_t:s0-s0:c0.c1023 old-auid=4294967295 auid=0 tty=ttyS0 old-ses=4294967295 ses=1 res=1 ---- time->Tue Mar 19 12:23:15 2019 type=PROCTITLE msg=audit(1553012595.401:219): proctitle=2F62696E2F6C6F67696E002D70002D2D0020202020 type=SYSCALL msg=audit(1553012595.401:219): arch=c000003e syscall=1 success=yes exit=1 a0=3 a1=7fff3fb13380 a2=1 a3=0 items=0 ppid=1 pid=647 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=ttyS0 ses=1 comm="login" exe="/usr/bin/login" subj=system_u:system_r:local_login_t:s0-s0:c0.c1023 key=(null) ---- Tidy up the list/ranges of records to be in ascending order for easier parsing and updating by humans. See the upstream issues https://github.com/linux-audit/audit-userspace/issues/86 Signed-off-by: Richard Guy Briggs --- src/ausearch-lol.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/ausearch-lol.c b/src/ausearch-lol.c index e70945612f79..f0f36e04dd93 100644 --- a/src/ausearch-lol.c +++ b/src/ausearch-lol.c @@ -246,12 +246,14 @@ static void check_events(lol *lo, time_t sec) if (cur->l->e.sec + 2 <= sec) { cur->status = L_COMPLETE; ready++; - } else if (cur->l->e.type == AUDIT_PROCTITLE || - cur->l->e.type < AUDIT_FIRST_EVENT || - cur->l->e.type >= AUDIT_FIRST_ANOM_MSG || - cur->l->e.type == AUDIT_KERNEL || - (cur->l->e.type >= AUDIT_MAC_UNLBL_ALLOW && - cur->l->e.type <= AUDIT_MAC_CALIPSO_DEL)) { + } else if ( cur->l->e.type < AUDIT_LOGIN || + (cur->l->e.type > AUDIT_LOGIN && + cur->l->e.type < AUDIT_FIRST_EVENT ) || + cur->l->e.type == AUDIT_PROCTITLE || + (cur->l->e.type >= AUDIT_MAC_UNLBL_ALLOW && + cur->l->e.type <= AUDIT_MAC_CALIPSO_DEL) || + cur->l->e.type == AUDIT_KERNEL || + cur->l->e.type >= AUDIT_FIRST_ANOM_MSG ) { // If known to be 1 record event, we are done cur->status = L_COMPLETE; ready++; -- 1.8.3.1 -- Linux-audit mailing list Linux-audit@redhat.com https://www.redhat.com/mailman/listinfo/linux-audit