summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-05-07 22:06:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-05-07 22:06:04 -0400
commit02aff8db6438ce29371fd9cd54c57213f4bb4536 (patch)
tree283941483dbe579bf413d3a03b0538ff7bdc336d /security
parentf72dae20891d7bcc43e9263ab206960b6ae5209f (diff)
parent70c4cf17e445264453bc5323db3e50aa0ac9e81f (diff)
Merge tag 'audit-pr-20190507' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit
Pull audit updates from Paul Moore: "We've got a reasonably broad set of audit patches for the v5.2 merge window, the highlights are below: - The biggest change, and the source of all the arch/* changes, is the patchset from Dmitry to help enable some of the work he is doing around PTRACE_GET_SYSCALL_INFO. To be honest, including this in the audit tree is a bit of a stretch, but it does help move audit a little further along towards proper syscall auditing for all arches, and everyone else seemed to agree that audit was a "good" spot for this to land (or maybe they just didn't want to merge it? dunno.). - We can now audit time/NTP adjustments. - We continue the work to connect associated audit records into a single event" * tag 'audit-pr-20190507' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit: (21 commits) audit: fix a memory leak bug ntp: Audit NTP parameters adjustment timekeeping: Audit clock adjustments audit: purge unnecessary list_empty calls audit: link integrity evm_write_xattrs record to syscall event syscall_get_arch: add "struct task_struct *" argument unicore32: define syscall_get_arch() Move EM_UNICORE to uapi/linux/elf-em.h nios2: define syscall_get_arch() nds32: define syscall_get_arch() Move EM_NDS32 to uapi/linux/elf-em.h m68k: define syscall_get_arch() hexagon: define syscall_get_arch() Move EM_HEXAGON to uapi/linux/elf-em.h h8300: define syscall_get_arch() c6x: define syscall_get_arch() arc: define syscall_get_arch() Move EM_ARCOMPACT and EM_ARCV2 to uapi/linux/elf-em.h audit: Make audit_log_cap and audit_copy_inode static audit: connect LOGIN record to its syscall record ...
Diffstat (limited to 'security')
-rw-r--r--security/integrity/evm/evm_secfs.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/security/integrity/evm/evm_secfs.c b/security/integrity/evm/evm_secfs.c
index 015aea8fdf1e..3f7cbb238923 100644
--- a/security/integrity/evm/evm_secfs.c
+++ b/security/integrity/evm/evm_secfs.c
@@ -192,7 +192,8 @@ static ssize_t evm_write_xattrs(struct file *file, const char __user *buf,
192 if (count > XATTR_NAME_MAX) 192 if (count > XATTR_NAME_MAX)
193 return -E2BIG; 193 return -E2BIG;
194 194
195 ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_INTEGRITY_EVM_XATTR); 195 ab = audit_log_start(audit_context(), GFP_KERNEL,
196 AUDIT_INTEGRITY_EVM_XATTR);
196 if (!ab) 197 if (!ab)
197 return -ENOMEM; 198 return -ENOMEM;
198 199
@@ -214,6 +215,9 @@ static ssize_t evm_write_xattrs(struct file *file, const char __user *buf,
214 if (len && xattr->name[len-1] == '\n') 215 if (len && xattr->name[len-1] == '\n')
215 xattr->name[len-1] = '\0'; 216 xattr->name[len-1] = '\0';
216 217
218 audit_log_format(ab, "xattr=");
219 audit_log_untrustedstring(ab, xattr->name);
220
217 if (strcmp(xattr->name, ".") == 0) { 221 if (strcmp(xattr->name, ".") == 0) {
218 evm_xattrs_locked = 1; 222 evm_xattrs_locked = 1;
219 newattrs.ia_mode = S_IFREG | 0440; 223 newattrs.ia_mode = S_IFREG | 0440;
@@ -222,15 +226,11 @@ static ssize_t evm_write_xattrs(struct file *file, const char __user *buf,
222 inode_lock(inode); 226 inode_lock(inode);
223 err = simple_setattr(evm_xattrs, &newattrs); 227 err = simple_setattr(evm_xattrs, &newattrs);
224 inode_unlock(inode); 228 inode_unlock(inode);
225 audit_log_format(ab, "locked");
226 if (!err) 229 if (!err)
227 err = count; 230 err = count;
228 goto out; 231 goto out;
229 } 232 }
230 233
231 audit_log_format(ab, "xattr=");
232 audit_log_untrustedstring(ab, xattr->name);
233
234 if (strncmp(xattr->name, XATTR_SECURITY_PREFIX, 234 if (strncmp(xattr->name, XATTR_SECURITY_PREFIX,
235 XATTR_SECURITY_PREFIX_LEN) != 0) { 235 XATTR_SECURITY_PREFIX_LEN) != 0) {
236 err = -EINVAL; 236 err = -EINVAL;