X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=kernel%2Faudit.c;h=ea3b7b6191c7af3347dce055a88af200c55d1f5d;hb=813e64382a8a4afcbfd7caeba40292a8ea6d5cc3;hp=4a3f28d2ca65239db79eee58b0e85366aa98669f;hpb=bca1a5c0eabe0f17081760c61e8d08e73dd6b6a6;p=mirror_ubuntu-bionic-kernel.git diff --git a/kernel/audit.c b/kernel/audit.c index 4a3f28d2ca65..ea3b7b6191c7 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