Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4065843imm; Mon, 17 Sep 2018 07:41:39 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaffCQv3gm0yc0FafCcJiXwjboiA+CjB5Gpy0Sh8c2Q7W/NgKucMNqpsn60aNQpehyh8xOT X-Received: by 2002:a17:902:1a9:: with SMTP id b38-v6mr25214068plb.89.1537195299193; Mon, 17 Sep 2018 07:41:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537195299; cv=none; d=google.com; s=arc-20160816; b=a++xKHxYkyQr+VhxhXQrWoOKeyzLjTSyOC4m/54oP3FwvHQ1bgVybx42qOQ9Sj0L1K e6/CTMvAOLRokxsiRcdg5Idn95Oai4pDW2sKHu+Dfe3iyCYy7m9JyEIzHXKB95Mmbz2w XNd2WGe4TIteRY2btZqVG8LP8wB2NUl+OgprIJpUdSnAfYVzHRPVhmBaL+FwO+vo+XNm 2VIUI9xJEGKZasGfqaXBG37aLfpG6vBVwAmA3OvqtFQTVeIQWFEIWe3AaSjmO1IFZhjT Y/O+pv6BJ7yW6+uBMk/PHUfEO1RZ4pFe97eXA/2SKXt8IiVdMhqdj+yj3csWbqJJq+7T /v9Q== 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=YvcYDOZzMlpWw9iZ9Xf7XiARsGauY32eqDn8b34M7TM=; b=X0EcPe8I/qpJQNXzOz2jFCidUPdA63d21ZPJlCok83mp76NALxVFHPkZn1wAX5fNsN ZRjd/I+j4iJeYa+tGJf13gghGqclMI2a9Jogtqi6Gy4wex2noY4MkKV6MCmn8yCsPsa+ Jj82komHFNO5Zf+8hdWu2ftMOmCuG4+U8twzGNbmVeuMkRIijB0u9WRAKcknYgGo3skM y+uasKXCKkczhSGKmtxPORBPzf2leJzvpWNhs0ZI1RiW8mJ3P8jEw/mx3mUa95Zggyl+ h4/S60s2b7Op/LNh/VM/XlGLWrlIT7i23TDctnCgcjvqwfcfIrlhh0Jc4UncmEHgS7Xj 1ojg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b="PrNmi/Rv"; 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 j3-v6si15037006pld.402.2018.09.17.07.41.13; Mon, 17 Sep 2018 07:41:39 -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="PrNmi/Rv"; 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 S1728816AbeIQUEk (ORCPT + 99 others); Mon, 17 Sep 2018 16:04:40 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:33016 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727858AbeIQUEj (ORCPT ); Mon, 17 Sep 2018 16:04:39 -0400 Received: by mail-lf1-f66.google.com with SMTP id m26-v6so13837634lfb.0 for ; Mon, 17 Sep 2018 07:37:02 -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=YvcYDOZzMlpWw9iZ9Xf7XiARsGauY32eqDn8b34M7TM=; b=PrNmi/RvKx3QbOvQsjxd3Hu8ZQkdLPTNSF2k3eo/kiZaYmKC89LMUID5v6G7K4SeuZ xftPSGHhsnlpTTVt7RM8NprN9lHcHKcdM8vV24Lj4ytOUDC0VRq4Y0Lxv9/ebdx2kcF6 bnBfLOuJqX6VR7KKo89ZO8xcpX2czAxlP+8I14aNEmvJFQ1BQG3IhdBHAhdKc+6Ut/Md 9a9zlGDhPGK8ZpylIMJVbbhV1mDrhocrNjdjuVvdhA+FLgsHo+9foN01O1nWJY2ussVc QMYbRdfIFhRSVPXD3u31tVV5M974sNIotuCX19vRledsfA/iEOlRIhVyO/xHDZM+biCk 6GQg== 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=YvcYDOZzMlpWw9iZ9Xf7XiARsGauY32eqDn8b34M7TM=; b=HCCxlnhX6fYMLZElq4/5VU9gOuTlS9OFfegBitD92RVyIlOh6LfXmaajHLiU1JMO8m 0DV6PMMbvTWy7UVMy5c66i7MzUHdVuy0RgXiXmLCpol19h211yWm9yItZiwN+5s38zJq fixZGNEq4/oL3HxBCGmSy+TwtsYih/qqaS89qCjpHCkVWVwjk21sN4amGPhJ0lk32/UU Cv9ydgd/ZlF9AbdA9s+lQjDLw7f/HKkPs7OmcntzmERRC9zAW2Frh4IsSRDSRMmO4kPB 5wgOJDgxpSXONSgh/tWV87swozYCK9D2BQog57BkH9WUxnQqrtUWIZL5SgKXdh1NabZz sVuw== X-Gm-Message-State: APzg51A9TpjXsKihKpHPSj6iMMXGpV1CDtw74UyYoScrVxvJb6CKndA7 tFxhlo/nW8KWNYPSkud9pcU95mPUAQfkSCXoueMe X-Received: by 2002:a19:14d4:: with SMTP id 81-v6mr6812213lfu.26.1537195021751; Mon, 17 Sep 2018 07:37:01 -0700 (PDT) MIME-Version: 1.0 References: <20180824120001.20771-1-omosnace@redhat.com> <20180824120001.20771-2-omosnace@redhat.com> <20180914151643.gwvm5te4nvion5ex@madcap2.tricolour.ca> In-Reply-To: <20180914151643.gwvm5te4nvion5ex@madcap2.tricolour.ca> From: Paul Moore Date: Mon, 17 Sep 2018 10:36:50 -0400 Message-ID: Subject: Re: [PATCH ghak10 v5 1/2] audit: Add functions to log time adjustments To: rgb@redhat.com Cc: omosnace@redhat.com, linux-audit@redhat.com, sgrubb@redhat.com, mlichvar@redhat.com, john.stultz@linaro.org, tglx@linutronix.de, sboyd@kernel.org, linux-kernel@vger.kernel.org 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 Fri, Sep 14, 2018 at 11:21 AM 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. Since there is already some precedence with the "=" format, and the field namespace is already a bit of a mess IMHO, I'd like us to stick with the style used by CONFIG_CHANGE. -- paul moore www.paul-moore.com