uti: syscall_backward: Use kmalloc area to pass syscall arguments
Change-Id: I478a9b40b75f3d1d68c4446810a6236fe2f3a96c Fujitsu: POSTK_DEBUG_ARCH_DEP_106 Refs: #1320
This commit is contained in:
@ -280,15 +280,16 @@ long syscall_backward(struct mcctrl_usrdata *usrdata, int num,
|
|||||||
struct mcctrl_per_proc_data *ppd;
|
struct mcctrl_per_proc_data *ppd;
|
||||||
struct mcctrl_per_thread_data *ptd;
|
struct mcctrl_per_thread_data *ptd;
|
||||||
unsigned long phys;
|
unsigned long phys;
|
||||||
struct syscall_request _request[2];
|
struct syscall_request *request = NULL;
|
||||||
struct syscall_request *request;
|
|
||||||
int retry;
|
int retry;
|
||||||
|
|
||||||
if (((unsigned long)_request ^ (unsigned long)(_request + 1)) &
|
request = kmalloc(sizeof(struct syscall_request), GFP_ATOMIC);
|
||||||
~(PAGE_SIZE -1))
|
if (!request) {
|
||||||
request = _request + 1;
|
printk("%s: ERROR: allocating request\n", __func__);
|
||||||
else
|
syscall_ret = -ENOMEM;
|
||||||
request = _request;
|
goto no_ppd;
|
||||||
|
}
|
||||||
|
|
||||||
request->number = num;
|
request->number = num;
|
||||||
request->args[0] = arg1;
|
request->args[0] = arg1;
|
||||||
request->args[1] = arg2;
|
request->args[1] = arg2;
|
||||||
@ -303,8 +304,9 @@ long syscall_backward(struct mcctrl_usrdata *usrdata, int num,
|
|||||||
|
|
||||||
if (!ppd) {
|
if (!ppd) {
|
||||||
kprintf("%s: ERROR: no per-process structure for PID %d??\n",
|
kprintf("%s: ERROR: no per-process structure for PID %d??\n",
|
||||||
__FUNCTION__, task_tgid_vnr(current));
|
__func__, task_tgid_vnr(current));
|
||||||
return -EINVAL;
|
syscall_ret = -EINVAL;
|
||||||
|
goto no_ppd;
|
||||||
}
|
}
|
||||||
|
|
||||||
ptd = mcctrl_get_per_thread_data(ppd, current);
|
ptd = mcctrl_get_per_thread_data(ppd, current);
|
||||||
@ -452,11 +454,13 @@ out:
|
|||||||
out_put_ppd:
|
out_put_ppd:
|
||||||
mcctrl_put_per_thread_data(ptd);
|
mcctrl_put_per_thread_data(ptd);
|
||||||
pr_ptd("put", task_pid_vnr(current), ptd);
|
pr_ptd("put", task_pid_vnr(current), ptd);
|
||||||
no_ptd:
|
no_ptd:
|
||||||
dprintk("%s: tid: %d, syscall: %d, syscall_ret: %lx\n",
|
dprintk("%s: tid: %d, syscall: %d, syscall_ret: %lx\n",
|
||||||
__FUNCTION__, task_pid_vnr(current), num, syscall_ret);
|
__FUNCTION__, task_pid_vnr(current), num, syscall_ret);
|
||||||
|
|
||||||
mcctrl_put_per_proc_data(ppd);
|
mcctrl_put_per_proc_data(ppd);
|
||||||
|
no_ppd:
|
||||||
|
kfree(request);
|
||||||
return syscall_ret;
|
return syscall_ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user