sanitize audit_ipc_obj()
* get rid of allocations * make it return void * simplify callers Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Цей коміт міститься в:
@@ -747,9 +747,7 @@ asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf)
|
||||
goto out;
|
||||
}
|
||||
|
||||
err = audit_ipc_obj(&(shp->shm_perm));
|
||||
if (err)
|
||||
goto out_unlock;
|
||||
audit_ipc_obj(&(shp->shm_perm));
|
||||
|
||||
if (!capable(CAP_IPC_LOCK)) {
|
||||
uid_t euid = current_euid();
|
||||
|
@@ -624,10 +624,9 @@ void ipc_rcu_putref(void *ptr)
|
||||
int ipcperms (struct kern_ipc_perm *ipcp, short flag)
|
||||
{ /* flag will most probably be 0 or S_...UGO from <linux/stat.h> */
|
||||
uid_t euid = current_euid();
|
||||
int requested_mode, granted_mode, err;
|
||||
int requested_mode, granted_mode;
|
||||
|
||||
if (unlikely((err = audit_ipc_obj(ipcp))))
|
||||
return err;
|
||||
audit_ipc_obj(ipcp);
|
||||
requested_mode = (flag >> 6) | (flag >> 3) | flag;
|
||||
granted_mode = ipcp->mode;
|
||||
if (euid == ipcp->cuid ||
|
||||
@@ -803,9 +802,7 @@ struct kern_ipc_perm *ipcctl_pre_down(struct ipc_ids *ids, int id, int cmd,
|
||||
goto out_up;
|
||||
}
|
||||
|
||||
err = audit_ipc_obj(ipcp);
|
||||
if (err)
|
||||
goto out_unlock;
|
||||
audit_ipc_obj(ipcp);
|
||||
|
||||
if (cmd == IPC_SET) {
|
||||
err = audit_ipc_set_perm(extra_perm, perm->uid,
|
||||
|
Посилання в новій задачі
Заблокувати користувача