diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/exec.c | 5 | ||||
-rw-r--r-- | fs/namei.c | 1 | ||||
-rw-r--r-- | fs/proc/base.c | 14 |
3 files changed, 12 insertions, 8 deletions
@@ -1380,10 +1380,6 @@ int search_binary_handler(struct linux_binprm *bprm) | |||
1380 | if (retval) | 1380 | if (retval) |
1381 | return retval; | 1381 | return retval; |
1382 | 1382 | ||
1383 | retval = audit_bprm(bprm); | ||
1384 | if (retval) | ||
1385 | return retval; | ||
1386 | |||
1387 | retval = -ENOENT; | 1383 | retval = -ENOENT; |
1388 | retry: | 1384 | retry: |
1389 | read_lock(&binfmt_lock); | 1385 | read_lock(&binfmt_lock); |
@@ -1431,6 +1427,7 @@ static int exec_binprm(struct linux_binprm *bprm) | |||
1431 | 1427 | ||
1432 | ret = search_binary_handler(bprm); | 1428 | ret = search_binary_handler(bprm); |
1433 | if (ret >= 0) { | 1429 | if (ret >= 0) { |
1430 | audit_bprm(bprm); | ||
1434 | trace_sched_process_exec(current, old_pid, bprm); | 1431 | trace_sched_process_exec(current, old_pid, bprm); |
1435 | ptrace_event(PTRACE_EVENT_EXEC, old_vpid); | 1432 | ptrace_event(PTRACE_EVENT_EXEC, old_vpid); |
1436 | current->did_exec = 1; | 1433 | current->did_exec = 1; |
diff --git a/fs/namei.c b/fs/namei.c index e029a4cbff7d..8f77a8cea289 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -2435,6 +2435,7 @@ static int may_delete(struct inode *dir, struct dentry *victim, bool isdir) | |||
2435 | */ | 2435 | */ |
2436 | static inline int may_create(struct inode *dir, struct dentry *child) | 2436 | static inline int may_create(struct inode *dir, struct dentry *child) |
2437 | { | 2437 | { |
2438 | audit_inode_child(dir, child, AUDIT_TYPE_CHILD_CREATE); | ||
2438 | if (child->d_inode) | 2439 | if (child->d_inode) |
2439 | return -EEXIST; | 2440 | return -EEXIST; |
2440 | if (IS_DEADDIR(dir)) | 2441 | if (IS_DEADDIR(dir)) |
diff --git a/fs/proc/base.c b/fs/proc/base.c index 1485e38daaa3..03c8d747be48 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -1151,10 +1151,16 @@ static ssize_t proc_loginuid_write(struct file * file, const char __user * buf, | |||
1151 | goto out_free_page; | 1151 | goto out_free_page; |
1152 | 1152 | ||
1153 | } | 1153 | } |
1154 | kloginuid = make_kuid(file->f_cred->user_ns, loginuid); | 1154 | |
1155 | if (!uid_valid(kloginuid)) { | 1155 | /* is userspace tring to explicitly UNSET the loginuid? */ |
1156 | length = -EINVAL; | 1156 | if (loginuid == AUDIT_UID_UNSET) { |
1157 | goto out_free_page; | 1157 | kloginuid = INVALID_UID; |
1158 | } else { | ||
1159 | kloginuid = make_kuid(file->f_cred->user_ns, loginuid); | ||
1160 | if (!uid_valid(kloginuid)) { | ||
1161 | length = -EINVAL; | ||
1162 | goto out_free_page; | ||
1163 | } | ||
1158 | } | 1164 | } |
1159 | 1165 | ||
1160 | length = audit_set_loginuid(kloginuid); | 1166 | length = audit_set_loginuid(kloginuid); |