X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=kernel%2Faudit.c;h=ea3b7b6191c7af3347dce055a88af200c55d1f5d;hb=4bbc6d52e61a8a9c19fcc859c4acab89cb8cd4e5;hp=4a3f28d2ca65239db79eee58b0e85366aa98669f;hpb=c511dc1fb6bee58363eb203d53393784f2589d02;p=~andy%2Flinux diff --git a/kernel/audit.c b/kernel/audit.c index 4a3f28d2ca6..ea3b7b6191c 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -1455,6 +1455,27 @@ void audit_log_key(struct audit_buffer *ab, char *key) audit_log_format(ab, "(null)"); } +/** + * audit_log_link_denied - report a link restriction denial + * @operation: specific link opreation + * @link: the path that triggered the restriction + */ +void audit_log_link_denied(const char *operation, struct path *link) +{ + struct audit_buffer *ab; + + ab = audit_log_start(current->audit_context, GFP_KERNEL, + AUDIT_ANOM_LINK); + audit_log_format(ab, "op=%s action=denied", operation); + audit_log_format(ab, " pid=%d comm=", current->pid); + audit_log_untrustedstring(ab, current->comm); + audit_log_d_path(ab, " path=", link); + audit_log_format(ab, " dev="); + audit_log_untrustedstring(ab, link->dentry->d_inode->i_sb->s_id); + audit_log_format(ab, " ino=%lu", link->dentry->d_inode->i_ino); + audit_log_end(ab); +} + /** * audit_log_end - end one audit record * @ab: the audit_buffer