diff options
Diffstat (limited to 'security/tomoyo/audit.c')
-rw-r--r-- | security/tomoyo/audit.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/security/tomoyo/audit.c b/security/tomoyo/audit.c index 7ef9fa3e37e0..c1b00375c9ad 100644 --- a/security/tomoyo/audit.c +++ b/security/tomoyo/audit.c | |||
@@ -168,9 +168,14 @@ static char *tomoyo_print_header(struct tomoyo_request_info *r) | |||
168 | stamp.day, stamp.hour, stamp.min, stamp.sec, r->profile, | 168 | stamp.day, stamp.hour, stamp.min, stamp.sec, r->profile, |
169 | tomoyo_mode[r->mode], tomoyo_yesno(r->granted), gpid, | 169 | tomoyo_mode[r->mode], tomoyo_yesno(r->granted), gpid, |
170 | tomoyo_sys_getpid(), tomoyo_sys_getppid(), | 170 | tomoyo_sys_getpid(), tomoyo_sys_getppid(), |
171 | current_uid(), current_gid(), current_euid(), | 171 | from_kuid(&init_user_ns, current_uid()), |
172 | current_egid(), current_suid(), current_sgid(), | 172 | from_kgid(&init_user_ns, current_gid()), |
173 | current_fsuid(), current_fsgid()); | 173 | from_kuid(&init_user_ns, current_euid()), |
174 | from_kgid(&init_user_ns, current_egid()), | ||
175 | from_kuid(&init_user_ns, current_suid()), | ||
176 | from_kgid(&init_user_ns, current_sgid()), | ||
177 | from_kuid(&init_user_ns, current_fsuid()), | ||
178 | from_kgid(&init_user_ns, current_fsgid())); | ||
174 | if (!obj) | 179 | if (!obj) |
175 | goto no_obj_info; | 180 | goto no_obj_info; |
176 | if (!obj->validate_done) { | 181 | if (!obj->validate_done) { |
@@ -191,15 +196,19 @@ static char *tomoyo_print_header(struct tomoyo_request_info *r) | |||
191 | tomoyo_buffer_len - 1 - pos, | 196 | tomoyo_buffer_len - 1 - pos, |
192 | " path%u.parent={ uid=%u gid=%u " | 197 | " path%u.parent={ uid=%u gid=%u " |
193 | "ino=%lu perm=0%o }", (i >> 1) + 1, | 198 | "ino=%lu perm=0%o }", (i >> 1) + 1, |
194 | stat->uid, stat->gid, (unsigned long) | 199 | from_kuid(&init_user_ns, stat->uid), |
195 | stat->ino, stat->mode & S_IALLUGO); | 200 | from_kgid(&init_user_ns, stat->gid), |
201 | (unsigned long)stat->ino, | ||
202 | stat->mode & S_IALLUGO); | ||
196 | continue; | 203 | continue; |
197 | } | 204 | } |
198 | pos += snprintf(buffer + pos, tomoyo_buffer_len - 1 - pos, | 205 | pos += snprintf(buffer + pos, tomoyo_buffer_len - 1 - pos, |
199 | " path%u={ uid=%u gid=%u ino=%lu major=%u" | 206 | " path%u={ uid=%u gid=%u ino=%lu major=%u" |
200 | " minor=%u perm=0%o type=%s", (i >> 1) + 1, | 207 | " minor=%u perm=0%o type=%s", (i >> 1) + 1, |
201 | stat->uid, stat->gid, (unsigned long) | 208 | from_kuid(&init_user_ns, stat->uid), |
202 | stat->ino, MAJOR(dev), MINOR(dev), | 209 | from_kgid(&init_user_ns, stat->gid), |
210 | (unsigned long)stat->ino, | ||
211 | MAJOR(dev), MINOR(dev), | ||
203 | mode & S_IALLUGO, tomoyo_filetype(mode)); | 212 | mode & S_IALLUGO, tomoyo_filetype(mode)); |
204 | if (S_ISCHR(mode) || S_ISBLK(mode)) { | 213 | if (S_ISCHR(mode) || S_ISBLK(mode)) { |
205 | dev = stat->rdev; | 214 | dev = stat->rdev; |