Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1886019ybn; Thu, 26 Sep 2019 03:47:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqxoGbOvMNwkyiDiMN5ZxCupG7Cf9iuQNOE4qhCom0R6eY8frcir+v0n4rqTk1z/SmP+kdPH X-Received: by 2002:a50:dac2:: with SMTP id s2mr2828060edj.26.1569494834361; Thu, 26 Sep 2019 03:47:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569494834; cv=none; d=google.com; s=arc-20160816; b=CMvgtXYrhk4ZYLdV5s3NnD3QXakn8U9Mx3wGbPZiZs805PLjWiBpiIIoAEq+x+FdsD IHXuVcqXQRtuvztEjsTgta4nthkwVmDDc126uWSYpH1Gu7QeaNLNVGqgI5sYr0/S7Hn0 7FHj2NQAeHJSQ8erUXm4pCV8nAmESTwAY6/OWRl9s8S1nQSAXfRCUyCvHnsbTrXVq7w4 370fCsAr+e84mBzmRSxP6GBUIRabSE70tukh0OUyPzQeVOhp58P6mYjD5A1Bj3swA4m0 M9RzwLCXXE92Na2YAKFmOACQqaqTiYM0nAE1aq6HKv5UtAACWz6MxfuvQ6uLfrAVxc3U lq4A== 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=PaeMc0t03cIGJW3QCybDKTEg7Rhlae4QY/t/oXRSyF0=; b=chjb0IcRhCzLxPIivLP86UED2IW5uhiCsjqBI6/rMbn0swgOEZW65kzQ5wqE6z/fxU VHOhL2DoWtOtfGeXMQaMrPeTzSStqj6wZQWIG0idD4ckKBzTitjue1zV6rR09rFIitRA IAOClM95jWhqxbOk78ybs48AKS8F6THgjtsWznE1i3ajzHASsPbEROVqhPtYVS3PPybj jSDT/dFJYObsHXhn+rHsUqxr45tiINOG1j5klcA+bnvtUX4CGBURAraZSS3RSuFOj7Vx 3yUQl7qS4U0mCF1fMyUFwG1A6lAxteBvQvTJaBNTI4S5ylVTQQRzfu7vcoEgAllX9Nry EPog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=QFv1USPh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v20si1053214edq.195.2019.09.26.03.46.50; Thu, 26 Sep 2019 03:47:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=QFv1USPh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404213AbfIXRF2 (ORCPT + 99 others); Tue, 24 Sep 2019 13:05:28 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:34215 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726859AbfIXRF2 (ORCPT ); Tue, 24 Sep 2019 13:05:28 -0400 Received: by mail-lf1-f68.google.com with SMTP id r22so2000865lfm.1 for ; Tue, 24 Sep 2019 10:05:27 -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=PaeMc0t03cIGJW3QCybDKTEg7Rhlae4QY/t/oXRSyF0=; b=QFv1USPh0kNsLjLCn6KDhZ6GOehlhwbx8pj60BxT28JgW2JJ44jJTWI4aSbCVZ1+9x 2hKmXsG3n0Nit+HSF3mYHiJrQFCZYU5Ve499Mh9JNJGgh8WI4FggQdw++ycae7dGiYA/ NY8tdPd5Lelka6KQay8aA2D1A7cQqQGDeERsv9nP+/dTWoaDccrq879qpoyqKX6kZRRU L0YWSkYOjDI+c5Y+Gq4bpfqpw/XKcyFHOysPAHeawHOxw1TziWokzSMnObU86E5vKgxt 76UQ/7F+YB0AlT1ZggGhdG/TnKNvgjCR+g940FQhBJI0WO/AKqsraEuFB9Lca3sGpxCk 8EIQ== 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=PaeMc0t03cIGJW3QCybDKTEg7Rhlae4QY/t/oXRSyF0=; b=Fl4CRX7spdjicyADyBM12SUr/R2RGAqWgjadsqnCS6C9skCUYptYzxng0+pm2NuEIl tGqiiYoFFQ8gtYf4ZurjNOyTveJdEjkm0W0nNulu+20My7UyXIDI2I84C7xAj2RuCSKz FYG0ztreBdk4Y/rgi1gWUyfYMpYzVdERaSk0wW4buM9KfNCQSBrss3QMLIMFEnFiH8R0 nj+qn/J3Ej/WD0wAG+3Y6QVjuuDlWC8DZnSKrgCzzJx2odJQgt1pCi7RXK6UVCK7cBiL jw2OXAypwh/bCSCt2eEBv+GRSKeCEf14AvJHOMrtJK7m4tBWL2p32qWIWS9/IOliPN63 ZJqw== X-Gm-Message-State: APjAAAWasvzc/Owe3KuMX/tXN5lgL6s6vsbx8/mrxUMGH21JenGEEO4J i28z88CPUfXqGkgCR3VDhIJAR3jC0Gd74vjKycdZ X-Received: by 2002:a19:6517:: with SMTP id z23mr2345791lfb.31.1569344725960; Tue, 24 Sep 2019 10:05:25 -0700 (PDT) MIME-Version: 1.0 References: <20190923155041.GA14807@codemonkey.org.uk> <20190923210021.5vfc2fo4wopennj5@madcap2.tricolour.ca> <20190924135046.kkt5hntbjpcampwr@madcap2.tricolour.ca> In-Reply-To: <20190924135046.kkt5hntbjpcampwr@madcap2.tricolour.ca> From: Paul Moore Date: Tue, 24 Sep 2019 13:05:14 -0400 Message-ID: Subject: Re: ntp audit spew. To: Richard Guy Briggs Cc: Dave Jones , linux-audit@redhat.com, Linux Kernel 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 Tue, Sep 24, 2019 at 9:50 AM Richard Guy Briggs wrote: > On 2019-09-23 23:01, Paul Moore wrote: > > On Mon, Sep 23, 2019 at 5:00 PM Richard Guy Briggs wrote: > > > On 2019-09-23 12:14, Paul Moore wrote: > > > > On Mon, Sep 23, 2019 at 11:50 AM Dave Jones wrote: > > > > > > > > > > I have some hosts that are constantly spewing audit messages like so: > > > > > > > > > > [46897.591182] audit: type=1333 audit(1569250288.663:220): op=offset old=2543677901372 new=2980866217213 > > > > > [46897.591184] audit: type=1333 audit(1569250288.663:221): op=freq old=-2443166611284 new=-2436281764244 > > > > > > Odd. It appears these two above should have the same serial number and > > > should be accompanied by a syscall record. It appears that it has no > > > context to update to connect the two records. Is it possible it is not > > > being called in a task context? If that were the case though, I'd > > > expect audit_dummy_context() to return 1... > > > > Yeah, I'm a little confused with these messages too. As you pointed > > out, the different serial numbers imply that the audit_context is NULL > > and if the audit_context is NULL I would have expected it to fail the > > audit_dummy_context() check in audit_ntp_log(). I'm looking at this > > with tired eyes at the moment, so I'm likely missing something, but I > > just don't see it right now ... > > > > What is even more confusing is that I don't see this issue on my test systems. > > > > > Checking audit_enabled should not be necessary but might fix the > > > problem, but still not explain why we're getting these records. > > > > I'd like to understand why this is happening before we start changing the code. > > Absolutely. > > This looks like a similar issue to the AUDIT_NETFILTER_CFG issue where > we get a lone record unconnected to a syscall when one of the netfilter > table initialization (ipv4 filter) is linked into the kernel rather than > compiled as a module, so it is run in kernel context at boot rather than > in user context as a module load later. This is why I ask if it is > being run by a kernel thread rather than a user task, perhaps using a > syscall function call internally. I don't see where in the code that could happen, but I agree that it looks like it; maybe I'm just missing a code path somewhere. Is anyone else seeing these records? Granted my audit test systems are running chrony, not ntp, but the syscalls/behaviors should be similar and I can't seem to recreate this. -- paul moore www.paul-moore.com