summaryrefslogtreecommitdiffstats
path: root/kernel/auditsc.c
diff options
context:
space:
mode:
authorRichard Guy Briggs <rgb@redhat.com>2019-01-23 21:36:25 -0500
committerPaul Moore <paul@paul-moore.com>2019-01-25 13:31:23 -0500
commit2fec30e245a3b46fef89c4cb1f74eefc5fbb29a6 (patch)
tree30f896171576cf88bf31c1cdd6c26140ab1ab47f /kernel/auditsc.c
parent4b7d248b3a1de483ffe9d05c1debbf32a544164d (diff)
audit: add support for fcaps v3
V3 namespaced file capabilities were introduced in commit 8db6c34f1dbc ("Introduce v3 namespaced file capabilities") Add support for these by adding the "frootid" field to the existing fcaps fields in the NAME and BPRM_FCAPS records. Please see github issue https://github.com/linux-audit/audit-kernel/issues/103 Signed-off-by: Richard Guy Briggs <rgb@redhat.com> Acked-by: Serge Hallyn <serge@hallyn.com> [PM: comment tweak to fit an 80 char line width] Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'kernel/auditsc.c')
-rw-r--r--kernel/auditsc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index 572d247957fb..c16beb25fd0a 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -1358,6 +1358,9 @@ static void audit_log_exit(void)
1358 audit_log_cap(ab, "pi", &axs->new_pcap.inheritable); 1358 audit_log_cap(ab, "pi", &axs->new_pcap.inheritable);
1359 audit_log_cap(ab, "pe", &axs->new_pcap.effective); 1359 audit_log_cap(ab, "pe", &axs->new_pcap.effective);
1360 audit_log_cap(ab, "pa", &axs->new_pcap.ambient); 1360 audit_log_cap(ab, "pa", &axs->new_pcap.ambient);
1361 audit_log_format(ab, " frootid=%d",
1362 from_kuid(&init_user_ns,
1363 axs->fcap.rootid));
1361 break; } 1364 break; }
1362 1365
1363 } 1366 }
@@ -2271,6 +2274,7 @@ int __audit_log_bprm_fcaps(struct linux_binprm *bprm,
2271 ax->fcap.permitted = vcaps.permitted; 2274 ax->fcap.permitted = vcaps.permitted;
2272 ax->fcap.inheritable = vcaps.inheritable; 2275 ax->fcap.inheritable = vcaps.inheritable;
2273 ax->fcap.fE = !!(vcaps.magic_etc & VFS_CAP_FLAGS_EFFECTIVE); 2276 ax->fcap.fE = !!(vcaps.magic_etc & VFS_CAP_FLAGS_EFFECTIVE);
2277 ax->fcap.rootid = vcaps.rootid;
2274 ax->fcap_ver = (vcaps.magic_etc & VFS_CAP_REVISION_MASK) >> VFS_CAP_REVISION_SHIFT; 2278 ax->fcap_ver = (vcaps.magic_etc & VFS_CAP_REVISION_MASK) >> VFS_CAP_REVISION_SHIFT;
2275 2279
2276 ax->old_pcap.permitted = old->cap_permitted; 2280 ax->old_pcap.permitted = old->cap_permitted;