aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/parisc')
-rw-r--r--arch/parisc/kernel/sys_parisc.c33
1 files changed, 10 insertions, 23 deletions
diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c
index 1db5588ceacf..512642d8f707 100644
--- a/arch/parisc/kernel/sys_parisc.c
+++ b/arch/parisc/kernel/sys_parisc.c
@@ -266,30 +266,17 @@ long parisc_personality(unsigned long personality)
266 return err; 266 return err;
267} 267}
268 268
269static inline int override_machine(char __user *mach) { 269long parisc_newuname(struct new_utsname __user *name)
270#ifdef CONFIG_COMPAT
271 if (personality(current->personality) == PER_LINUX32) {
272 if (__put_user(0, mach + 6) ||
273 __put_user(0, mach + 7))
274 return -EFAULT;
275 }
276
277 return 0;
278#else /*!CONFIG_COMPAT*/
279 return 0;
280#endif /*CONFIG_COMPAT*/
281}
282
283long parisc_newuname(struct new_utsname __user *utsname)
284{ 270{
285 int err = 0; 271 int err = sys_newuname(name);
286 272
287 down_read(&uts_sem); 273#ifdef CONFIG_COMPAT
288 if (copy_to_user(utsname, &system_utsname, sizeof(*utsname))) 274 if (!err && personality(current->personality) == PER_LINUX32) {
289 err = -EFAULT; 275 if (__put_user(0, name->machine + 6) ||
290 up_read(&uts_sem); 276 __put_user(0, name->machine + 7))
291 277 err = -EFAULT;
292 err = override_machine(utsname->machine); 278 }
279#endif
293 280
294 return (long)err; 281 return err;
295} 282}