linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH ghak10 v5 0/2] audit: Log modifying adjtimex(2) calls
@ 2018-08-24 11:59 Ondrej Mosnacek
  2018-08-24 12:00 ` [PATCH ghak10 v5 1/2] audit: Add functions to log time adjustments Ondrej Mosnacek
  2018-08-24 12:00 ` [PATCH ghak10 v5 2/2] timekeeping/ntp: Audit clock/NTP params adjustments Ondrej Mosnacek
  0 siblings, 2 replies; 32+ messages in thread
From: Ondrej Mosnacek @ 2018-08-24 11:59 UTC (permalink / raw)
  To: linux-audit
  Cc: Paul Moore, Richard Guy Briggs, Steve Grubb, Miroslav Lichvar,
	John Stultz, Thomas Gleixner, Stephen Boyd, linux-kernel,
	Ondrej Mosnacek

This patchset implements more detailed auditing of the adjtimex(2)
syscall in order to make it possible to:
  a) distinguish modifying vs. read-only calls in the audit log
  b) reconstruct from the audit log what changes were made and how they
     have influenced the system clock

The main motivation is to be able to detect an adversary that tries to
confuse the audit timestamps by changing system time via adjtimex(2),
but at the same time avoid flooding the audit log with records of benign
read-only adjtimex(2) calls.

The current version of the patchset logs the following changes:
  - direct injection of timekeeping offset
  - adjustment of timekeeping's TAI offset
  - NTP value adjustments:
    - time_offset
    - time_freq
    - time_status
    - time_adjust
    - tick_usec

Changes to the following NTP values are not logged, as they are not
important for security:
  - time_maxerror
  - time_esterror
  - time_constant

Audit kernel GitHub issue: https://github.com/linux-audit/audit-kernel/issues/10

Changes in v5:
  - Dropped logging of some less important changes and update commit messages
  - No longer mark the patchset as RFC

v4: https://www.redhat.com/archives/linux-audit/2018-August/msg00023.html
Changes in v4:
  - Squashed first two patches into one
  - Renamed ADJNTPVAL's "type" field to "op" to align with audit record
    conventions
  - Minor commit message editing
  - Cc timekeeping/NTP people for feedback

v3: https://www.redhat.com/archives/linux-audit/2018-July/msg00001.html
Changes in v3:
  - Switched to separate records for each variable
  - Both old and new value is now reported for each change
  - Injecting offset is reported via a separate record (since this
    offset consists of two values and is added directly to the clock,
    i.e. it doesn't make sense to log old and new value)
  - Added example records produced by chronyd -q (see the commit message
    of the last patch)

v2: https://www.redhat.com/archives/linux-audit/2018-June/msg00114.html
Changes in v2:
  - The audit_adjtime() function has been modified to only log those
    fields that contain values that are actually used, resulting in more
    compact records.
  - The audit_adjtime() call has been moved to do_adjtimex() in
    timekeeping.c
  - Added an additional patch (for review) that simplifies the detection
    if the syscall is read-only.

v1: https://www.redhat.com/archives/linux-audit/2018-June/msg00095.html

Ondrej Mosnacek (2):
  audit: Add functions to log time adjustments
  timekeeping/ntp: Audit clock/NTP params adjustments

 include/linux/audit.h      | 21 +++++++++++++++++++++
 include/uapi/linux/audit.h |  2 ++
 kernel/auditsc.c           | 15 +++++++++++++++
 kernel/time/ntp.c          | 38 ++++++++++++++++++++++++++++++--------
 kernel/time/timekeeping.c  |  3 +++
 5 files changed, 71 insertions(+), 8 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2018-09-22 20:42 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-24 11:59 [PATCH ghak10 v5 0/2] audit: Log modifying adjtimex(2) calls Ondrej Mosnacek
2018-08-24 12:00 ` [PATCH ghak10 v5 1/2] audit: Add functions to log time adjustments Ondrej Mosnacek
2018-08-24 18:33   ` John Stultz
2018-08-27  8:28     ` Ondrej Mosnacek
2018-09-13 15:54       ` Richard Guy Briggs
2018-09-17 12:33         ` Ondrej Mosnacek
2018-08-27  7:50   ` Miroslav Lichvar
2018-08-27  9:13     ` Ondrej Mosnacek
2018-08-27 16:38       ` Steve Grubb
2018-09-13 13:59         ` Ondrej Mosnacek
2018-09-13 15:14           ` Richard Guy Briggs
2018-09-17 12:32             ` Ondrej Mosnacek
2018-09-14  3:09           ` Paul Moore
2018-09-17 12:33             ` Ondrej Mosnacek
2018-09-14  3:18   ` Paul Moore
2018-09-14 15:16     ` Richard Guy Briggs
2018-09-14 15:34       ` Steve Grubb
2018-09-14 16:24         ` Richard Guy Briggs
2018-09-17 14:36       ` Paul Moore
2018-09-17 12:38     ` Ondrej Mosnacek
2018-09-17 14:20       ` Richard Guy Briggs
2018-09-17 14:50       ` Paul Moore
2018-09-21 11:21         ` Ondrej Mosnacek
2018-09-22 20:42           ` Paul Moore
2018-08-24 12:00 ` [PATCH ghak10 v5 2/2] timekeeping/ntp: Audit clock/NTP params adjustments Ondrej Mosnacek
2018-08-24 19:47   ` Richard Guy Briggs
2018-08-24 20:20     ` John Stultz
2018-08-27 11:35     ` Ondrej Mosnacek
2018-08-27 11:45       ` Miroslav Lichvar
2018-08-27 12:02         ` Ondrej Mosnacek
2018-08-27 21:42         ` Thomas Gleixner
2018-09-13 15:35       ` Richard Guy Briggs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).