Lines 25-30
Link Here
|
25 |
#include <linux/posix-timers.h> |
25 |
#include <linux/posix-timers.h> |
26 |
#include <linux/times.h> |
26 |
#include <linux/times.h> |
27 |
#include <linux/ptrace.h> |
27 |
#include <linux/ptrace.h> |
|
|
28 |
#include <linux/module.h> |
28 |
#include <linux/gfp.h> |
29 |
#include <linux/gfp.h> |
29 |
|
30 |
|
30 |
#include <asm/uaccess.h> |
31 |
#include <asm/uaccess.h> |
Lines 1137-1139
compat_sys_sysinfo(struct compat_sysinfo
Link Here
|
1137 |
|
1138 |
|
1138 |
return 0; |
1139 |
return 0; |
1139 |
} |
1140 |
} |
|
|
1141 |
|
1142 |
/* |
1143 |
* Allocate user-space memory for the duration of a single system call, |
1144 |
* in order to marshall parameters inside a compat thunk. |
1145 |
*/ |
1146 |
void __user *compat_alloc_user_space(unsigned long len) |
1147 |
{ |
1148 |
void __user *ptr; |
1149 |
|
1150 |
/* If len would occupy more than half of the entire compat space... */ |
1151 |
if (unlikely(len > (((compat_uptr_t)~0) >> 1))) |
1152 |
return NULL; |
1153 |
|
1154 |
ptr = arch_compat_alloc_user_space(len); |
1155 |
|
1156 |
if (unlikely(!access_ok(VERIFY_WRITE, ptr, len))) |
1157 |
return NULL; |
1158 |
|
1159 |
return ptr; |
1160 |
} |
1161 |
EXPORT_SYMBOL_GPL(compat_alloc_user_space); |