History

audit: fix incorrect inheritable capability in CAPSET records

__audit_log_capset() records the effective capability set into the inheritable field due to a copy-paste error. Every CAPSET audit record therefore reports cap_pi (process inheritable) with the value of cap_effective instead of cap_inheritable. This silently corrupts audit data used for compliance and forensic analysis: an attacker who modifies inheritable capabilities to prepare for a privilege-escalating exec would have the change masked in the audit trail. The bug has been present since the original introduction of CAPSET audit records in 2008.

Sergio Correia committed 6 months ago

Commit e4a64041 parent 254f4961 file · +1 −1Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/auditsc.c+1−1
@@ -2786,7 +2786,7 @@ void __audit_log_capset(const struct cred *new, const struct cred *old) · 2785 unmodified lines
27862786
27872787 context->capset.pid = task_tgid_nr(current);
27882788 context->capset.cap.effective = new->cap_effective;
2789− context->capset.cap.inheritable = new->cap_effective;
2789+ context->capset.cap.inheritable = new->cap_inheritable;
27902790 context->capset.cap.permitted = new->cap_permitted;
27912791 context->capset.cap.ambient = new->cap_ambient;
27922792 context->type = AUDIT_CAPSET;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t