Skip to content

fanotify: Allow user space to pass back additional audit info

Steve Grubb linux-audit linux-fsdevel 1 version In review

Get series with b4
b4 am 2042449.irdbgypaU6@x2

Versions newest first

  1. v1 Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3fanotify: Ensure consistent variable type for responsefs/notify/fanotify/fanotify.h fs/notify/fanotify/fanotify_user.c+3 -31 reply
2/3fanotify: define bit map fields to hold response decision contextfs/notify/fanotify/fanotify.c fs/notify/fanotify/fanotify_user.c include/linux/fanotify.h +1 more+38 -83 replies
3/3fanotify: Allow audit to use the full permission event responsefs/notify/fanotify/fanotify.c kernel/auditsc.c+6 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] fanotify: Allow user space to pass back additional audit info

The Fanotify API can be used for access control by requesting permission event notification. The user space tooling that uses it may have a complicated policy that inherently contains additional context for the decision. If this information were available in the audit trail, policy writers can close the loop on debugging policy. Also, if this additional information were available, it would enable the creation of tools that can suggest changes to the policy similar to how audit2allow can help refine labeled security.

This patch defines 2 bit maps within the response variable returned from user space on a permission event. The first field is 3 bits for the context type. The context type will describe what the meaning is of the second bit field. The audit system will separate the pieces and log them individually.

The audit function was updated to log the additional information in the AUDIT_FANOTIFY record. The following is an example of the new record format:

type=FANOTIFY msg=audit(1600385147.372:590): resp=2 ctx_type=1 fan_ctx=17

Steve Grubb (3):
fanotify: Ensure consistent variable type for response
fanotify: define bit map fields to hold response decision context
fanotify: Allow audit to use the full permission event response

 fs/notify/fanotify/fanotify.c      |  5 ++---
 fs/notify/fanotify/fanotify.h      |  2 +-
 fs/notify/fanotify/fanotify_user.c | 11 +++--------
 include/linux/fanotify.h           |  5 +++++
 include/uapi/linux/fanotify.h      | 31 ++++++++++++++++++++++++++++++
 kernel/auditsc.c                   |  7 +++++--
 6 files changed, 47 insertions(+), 14 deletions(-)
Signature · 1 line
2.26.2