Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp997743imm; Fri, 14 Sep 2018 09:30:30 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaWGFWMs00+fNK+xq0xRfvriFVQeSHZBu+zqGFXqUTNWXN+xowwvQ/7qBCfBNjjAGdjLrXZ X-Received: by 2002:a63:e50a:: with SMTP id r10-v6mr10946064pgh.170.1536942630728; Fri, 14 Sep 2018 09:30:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536942630; cv=none; d=google.com; s=arc-20160816; b=ObOzvyLIKMOXoi7vBIlTCzoVV0yye+TWPm6mUrhH+OBWRRKFSy0+CbohJGkoyBDSPb koGa3E+G9FsR1AbIrwncQ4uLn8Vz0Euf3rB1t9X/qeDrcUw4Wpmmy/Ho7kUFmnr/ippS 1ylQa105Fq+fFnWh/Z0aeGHbzlyvmgp7XIQru766p3m7J+s1lKFOVUwPkUONRC2BM15+ 5vD5ls4I27p4Ok6B0jxfjpNUrP5AKYzWeTCuk1nrvuqKoMrm7P+X64fmbmltDVXsBRud IDJe8uYBZTQ79gGbNWSS7f1bdRYsbRvQr3eLJQFML9zonWfuchi/n/fncgSLllpeDEcO 4nWg== 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; bh=kbUOTPkVr1IUJEuzvVRCZb+JTdcLKQrWaRwvIQiFa84=; b=wfLCOyKrkI3KOUgdY72d2NBXYy9CcUWzvCDbeJgu/fuxY0SJzb+0C1Y01yzmMPeoTx vSIa/QiHWIo3FV6K84OPVtsfU8WG5diKwEZ6DYm4F3aXBRRhJbU09Z40XrOUmfyeBNDm ssiV3WbV18IrBN1oKTlaebBRUaTiu8cc4M9OkDPvk9O+oP2yhp/WBOP9SZtw3eBzb5s0 jinptwdHdr2HQ795PEoE5h99rNbWimcO7oRFddvfzWfcblBBU2TVG8vP3CFABLCX3jlK FarxQie2u24sEYDThwUVidzJL1reH7GDeJQAgYtX1JlgQSxCQO9qvsBx6tFYLo7WljAE eHDw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2-v6si7645013pfb.262.2018.09.14.09.30.14; Fri, 14 Sep 2018 09:30:30 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728294AbeINVoN (ORCPT + 99 others); Fri, 14 Sep 2018 17:44:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47392 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726902AbeINVoN (ORCPT ); Fri, 14 Sep 2018 17:44:13 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 742E4307CF58; Fri, 14 Sep 2018 16:28:59 +0000 (UTC) Received: from madcap2.tricolour.ca (ovpn-112-40.phx2.redhat.com [10.3.112.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5DBEE600C6; Fri, 14 Sep 2018 16:28:47 +0000 (UTC) Date: Fri, 14 Sep 2018 12:24:03 -0400 From: Richard Guy Briggs To: Steve Grubb Cc: sboyd@kernel.org, linux-kernel@vger.kernel.org, mlichvar@redhat.com, linux-audit@redhat.com, john.stultz@linaro.org, tglx@linutronix.de Subject: Re: [PATCH ghak10 v5 1/2] audit: Add functions to log time adjustments Message-ID: <20180914162403.d2njtt2cp7slbcsw@madcap2.tricolour.ca> References: <20180824120001.20771-1-omosnace@redhat.com> <20180914151643.gwvm5te4nvion5ex@madcap2.tricolour.ca> <2062051.Ftk13INWii@x2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2062051.Ftk13INWii@x2> User-Agent: NeoMutt/20180512 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Fri, 14 Sep 2018 16:28:59 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-09-14 11:34, Steve Grubb wrote: > On Friday, September 14, 2018 11:16:43 AM EDT Richard Guy Briggs wrote: > > On 2018-09-13 23:18, Paul Moore wrote: > > > On Fri, Aug 24, 2018 at 8:00 AM Ondrej Mosnacek > wrote: > > > > This patch adds two auxiliary record types that will be used to > > > > annotate > > > > the adjtimex SYSCALL records with the NTP/timekeeping values that have > > > > been changed. > > > > > > > > Next, it adds two functions to the audit interface: > > > > - audit_tk_injoffset(), which will be called whenever a timekeeping > > > > > > > > offset is injected by a syscall from userspace, > > > > > > > > - audit_ntp_adjust(), which will be called whenever an NTP internal > > > > > > > > variable is changed by a syscall from userspace. > > > > > > > > Quick reference for the fields of the new records: > > > > AUDIT_TIME_INJOFFSET > > > > > > > > sec - the 'seconds' part of the offset > > > > nsec - the 'nanoseconds' part of the offset > > > > > > > > AUDIT_TIME_ADJNTPVAL > > > > > > > > op - which value was adjusted: > > > > offset - corresponding to the time_offset variable > > > > freq - corresponding to the time_freq variable > > > > status - corresponding to the time_status variable > > > > adjust - corresponding to the time_adjust variable > > > > tick - corresponding to the tick_usec variable > > > > tai - corresponding to the timekeeping's TAI offset > > > > > > I understand that reusing "op" is tempting, but the above aren't > > > really operations, they are state variables which are being changed. > > > Using the CONFIG_CHANGE record as a basis, I wonder if we are better > > > > > > off with something like the following: > > > type=TIME_CHANGE = old= > > > > > > ... you might need to preface the variable names with something like > > > "ntp_" or "offset_". You'll notice I'm also suggesting we use a > > > single record type here; is there any reason why two records types are > > > required? > > > > Why not do something like: > > > > type=TIME_CHANGE var= new= old= > > > > So that we don't pollute the field namespace *and* create 8 variants on > > the same record format? This shouldn't be much of a concern with binary > > record formats, but we're stuck with the current parsing scheme for now. > > Something like this or the other format is fine. Neither hurt parsing because > these are not searchable fields. We only have issues when it involves a > searchable field name. Ok, fair enough. Thanks Steve. > HTH... > > -Steve > > > > > old - the old value > > > > new - the new value > > > > > > > > Signed-off-by: Ondrej Mosnacek > > > > --- > > > > > > > > include/linux/audit.h | 21 +++++++++++++++++++++ > > > > include/uapi/linux/audit.h | 2 ++ > > > > kernel/auditsc.c | 15 +++++++++++++++ > > > > 3 files changed, 38 insertions(+) > > > > > > A reminder that we need tests for these new records and a RFE page on the > > > wiki: > > > > > > * https://github.com/linux-audit/audit-testsuite > > > * https://github.com/linux-audit/audit-kernel/wiki > > > > - RGB - 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