Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2324360ybk; Sun, 17 May 2020 17:44:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuhuc+Sq/X2O5SGg41R9w7q7F2uf75YRvjKdW7LR6aUSBGUXjKZRe7E/kB79Kgd82us1wY X-Received: by 2002:a50:8d57:: with SMTP id t23mr11844680edt.168.1589762654680; Sun, 17 May 2020 17:44:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589762654; cv=none; d=google.com; s=arc-20160816; b=Q2Olhntg2TVvhSgNvdZhdIMN51IduqGSUkQVozYSZ9XG0jEiGHZ3oD2zSFdiHoOmFq oxdUxl0PI2Q1e+SfbrLIWmNecdr52JfHiWenb2iSs1dFGJk5WDUlElZtvJtYVZOwJm0b cFM6xLAJLhpDPXe3x1fAdelvFxOWJvQlZn4GFGVx/+LssheeonNjob6LCnREck6ydGUF r+BfsqDKrRBIHMp+F8zq0kMldIvfO/wx/qrSReMbVrLfq3FBbYe/EBUEZ4Laj3uwbszd swc/jrweNxp4ZG89vyN7fHr83IUL4pq558AIq8cbLixE/q3Dx9/+7AaNyKBpSHmNuprE HrTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ldgf5qCz+KPm0qgqX51insh5mQ/IcQUyFZCFAsumpxs=; b=VDqgV6KKbQ18S14ROd4iRMNqX6whZ2IAn62ArNXjcDmyq5A5nBuIp+ToHOvKHMRHtG oGjz9TN4CPRt+X03631VMWqb9w2HE86u8vuJHjGru6bPJ276E370k0rAcymqn7wltLDB oTJbVTmcFdPEqXygaAEua4tIRqum/zaB1TXpl6pzJz09NwrRpjD5WCf4IdnG4BQUExTa gFVuUC2DdD3dd8UFYnfguWy13SVjEubPxWqXz+2d0pAxBVwgADFvHjOVxL71S2Kt0pKZ K8l8E66jkTXGtH8CINjIxTpaFQ+LYMOW8+gkkOmEAnAXgA7Ez9KHY5U7Z/EKVfv7Hf42 ZmBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WhVTQuEf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p11si5033310edx.300.2020.05.17.17.43.51; Sun, 17 May 2020 17:44:14 -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=@redhat.com header.s=mimecast20190719 header.b=WhVTQuEf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726721AbgERAkI (ORCPT + 99 others); Sun, 17 May 2020 20:40:08 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:54462 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726668AbgERAkI (ORCPT ); Sun, 17 May 2020 20:40:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589762406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ldgf5qCz+KPm0qgqX51insh5mQ/IcQUyFZCFAsumpxs=; b=WhVTQuEfg46pETpoPphlLD3XlthdZ23nGyAOgIaK+JwFtftFhS2yadHWXbPwM4TabKbX12 Cc5LcBG3KGzE4SBzJtb32ym81h70taEmN8aCWR+hniD13pRpl2EOJ0b5lvt6bDG0vyCkZj UEgug1kgHZ1VwGcUvCaGe+G/Pj9pmX0= 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-108-fyxGpy4-PmylBpGtDqWUaA-1; Sun, 17 May 2020 20:40:04 -0400 X-MC-Unique: fyxGpy4-PmylBpGtDqWUaA-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 3266ABFC7; Mon, 18 May 2020 00:39:51 +0000 (UTC) Received: from madcap2.tricolour.ca (unknown [10.10.110.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5C55460C81; Mon, 18 May 2020 00:39:22 +0000 (UTC) Date: Sun, 17 May 2020 20:39:20 -0400 From: Richard Guy Briggs To: Paul Moore Cc: fw@strlen.de, LKML , Linux-Audit Mailing List , netfilter-devel@vger.kernel.org, ebiederm@xmission.com, twoerner@redhat.com, Eric Paris , tgraf@infradead.org Subject: Re: [PATCH ghak25 v4 3/3] audit: add subj creds to NETFILTER_CFG record to cover async unregister Message-ID: <20200518003920.e6vyzhvadyi5wdjd@madcap2.tricolour.ca> References: <20200517141515.qqx3jx5ulb2546tx@madcap2.tricolour.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 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 On 2020-05-17 17:50, Paul Moore wrote: > On Sun, May 17, 2020 at 10:15 AM Richard Guy Briggs wrote: > > On 2020-04-28 18:25, Paul Moore wrote: > > > On Wed, Apr 22, 2020 at 5:40 PM Richard Guy Briggs wrote: > > > > Some table unregister actions seem to be initiated by the kernel to > > > > garbage collect unused tables that are not initiated by any userspace > > > > actions. It was found to be necessary to add the subject credentials to > > > > cover this case to reveal the source of these actions. A sample record: > > > > > > > > type=NETFILTER_CFG msg=audit(2020-03-11 21:25:21.491:269) : table=nat family=bridge entries=0 op=unregister pid=153 uid=root auid=unset tty=(none) ses=unset subj=system_u:system_r:kernel_t:s0 comm=kworker/u4:2 exe=(null) > > > > > > [I'm going to comment up here instead of in the code because it is a > > > bit easier for everyone to see what the actual impact might be on the > > > records.] > > > > > > Steve wants subject info in this case, okay, but let's try to trim out > > > some of the fields which simply don't make sense in this record; I'm > > > thinking of fields that are unset/empty in the kernel case and are > > > duplicates of other records in the userspace/syscall case. I think > > > that means we can drop "tty", "ses", "comm", and "exe" ... yes? > > > > > > While "auid" is a potential target for removal based on the > > > dup-or-unset criteria, I think it falls under Steve's request for > > > subject info here, even if it is garbage in this case. > > > > Can you explain why auid falls under this criteria but ses does not if > > both are unset? > > "While "auid" is a potential target for removal based on the > dup-or-unset criteria, I think it falls under Steve's request for > subject info here, even if it is garbage in this case." > > It's a concession to Steve. As I mentioned previously, I think the > subject info is bogus in this case; either it is valid and we get it > from the SYSCALL record or it simply isn't present in any meaningful > way. Sorry for being so dense. I still don't follow your explanation. You've repeated the same paragraph that didn't make sense to me the first time. What definition of "subject info" are you working with? I had assumed it was the set of fields that contain information that came from that task's struct task_struct. Some of those fields contain information that isn't helpful. Why not remove them all rather than keep one that still contains no useful information? Or is it a matter of keeping one key field that contains no useful information that proves that the rest is bogus? Steve said that daemons leave no useful information in auid as well, so I don't see how keeping this field helps us. My understanding is that the subj field's "...:kernel_t:..." is the key here and that pid and comm give us a bit more of a clue that it is a kernel thread. Is that correct? What use does including auid serve here? I suppose that the uid field is somewhat useful, since the kernel could conceivably switch to a particular user to run a kernel thread. Is that even currently possible? > paul moore - RGB -- Richard Guy Briggs Sr. S/W Engineer, Kernel Security, Base Operating Systems Remote, Ottawa, Red Hat Canada IRC: rgb, SunRaycer Voice: +1.647.777.2635, Internal: (81) 32635