| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2008 IBM Corporation |
|---|
| 3 | 4 | * Author: Mimi Zohar <zohar@us.ibm.com> |
|---|
| 4 | | - * |
|---|
| 5 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 6 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 7 | | - * the Free Software Foundation, version 2 of the License. |
|---|
| 8 | 5 | * |
|---|
| 9 | 6 | * File: integrity_audit.c |
|---|
| 10 | 7 | * Audit calls for the integrity subsystem |
|---|
| .. | .. |
|---|
| 32 | 29 | const unsigned char *fname, const char *op, |
|---|
| 33 | 30 | const char *cause, int result, int audit_info) |
|---|
| 34 | 31 | { |
|---|
| 32 | + integrity_audit_message(audit_msgno, inode, fname, op, cause, |
|---|
| 33 | + result, audit_info, 0); |
|---|
| 34 | +} |
|---|
| 35 | + |
|---|
| 36 | +void integrity_audit_message(int audit_msgno, struct inode *inode, |
|---|
| 37 | + const unsigned char *fname, const char *op, |
|---|
| 38 | + const char *cause, int result, int audit_info, |
|---|
| 39 | + int errno) |
|---|
| 40 | +{ |
|---|
| 35 | 41 | struct audit_buffer *ab; |
|---|
| 36 | 42 | char name[TASK_COMM_LEN]; |
|---|
| 37 | 43 | |
|---|
| .. | .. |
|---|
| 43 | 49 | return; |
|---|
| 44 | 50 | audit_log_format(ab, "pid=%d uid=%u auid=%u ses=%u", |
|---|
| 45 | 51 | task_pid_nr(current), |
|---|
| 46 | | - from_kuid(&init_user_ns, current_cred()->uid), |
|---|
| 52 | + from_kuid(&init_user_ns, current_uid()), |
|---|
| 47 | 53 | from_kuid(&init_user_ns, audit_get_loginuid(current)), |
|---|
| 48 | 54 | audit_get_sessionid(current)); |
|---|
| 49 | 55 | audit_log_task_context(ab); |
|---|
| .. | .. |
|---|
| 58 | 64 | audit_log_untrustedstring(ab, inode->i_sb->s_id); |
|---|
| 59 | 65 | audit_log_format(ab, " ino=%lu", inode->i_ino); |
|---|
| 60 | 66 | } |
|---|
| 61 | | - audit_log_format(ab, " res=%d", !result); |
|---|
| 67 | + audit_log_format(ab, " res=%d errno=%d", !result, errno); |
|---|
| 62 | 68 | audit_log_end(ab); |
|---|
| 63 | 69 | } |
|---|