aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/compat.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/compat.c')
-rw-r--r--kernel/compat.c55
1 files changed, 0 insertions, 55 deletions
diff --git a/kernel/compat.c b/kernel/compat.c
index 3f5fa8902e7d..6d21894806b4 100644
--- a/kernel/compat.c
+++ b/kernel/compat.c
@@ -488,61 +488,6 @@ get_compat_sigset(sigset_t *set, const compat_sigset_t __user *compat)
488} 488}
489EXPORT_SYMBOL_GPL(get_compat_sigset); 489EXPORT_SYMBOL_GPL(get_compat_sigset);
490 490
491#ifdef CONFIG_NUMA
492COMPAT_SYSCALL_DEFINE6(move_pages, pid_t, pid, compat_ulong_t, nr_pages,
493 compat_uptr_t __user *, pages32,
494 const int __user *, nodes,
495 int __user *, status,
496 int, flags)
497{
498 const void __user * __user *pages;
499 int i;
500
501 pages = compat_alloc_user_space(nr_pages * sizeof(void *));
502 for (i = 0; i < nr_pages; i++) {
503 compat_uptr_t p;
504
505 if (get_user(p, pages32 + i) ||
506 put_user(compat_ptr(p), pages + i))
507 return -EFAULT;
508 }
509 return sys_move_pages(pid, nr_pages, pages, nodes, status, flags);
510}
511
512COMPAT_SYSCALL_DEFINE4(migrate_pages, compat_pid_t, pid,
513 compat_ulong_t, maxnode,
514 const compat_ulong_t __user *, old_nodes,
515 const compat_ulong_t __user *, new_nodes)
516{
517 unsigned long __user *old = NULL;
518 unsigned long __user *new = NULL;
519 nodemask_t tmp_mask;
520 unsigned long nr_bits;
521 unsigned long size;
522
523 nr_bits = min_t(unsigned long, maxnode - 1, MAX_NUMNODES);
524 size = ALIGN(nr_bits, BITS_PER_LONG) / 8;
525 if (old_nodes) {
526 if (compat_get_bitmap(nodes_addr(tmp_mask), old_nodes, nr_bits))
527 return -EFAULT;
528 old = compat_alloc_user_space(new_nodes ? size * 2 : size);
529 if (new_nodes)
530 new = old + size / sizeof(unsigned long);
531 if (copy_to_user(old, nodes_addr(tmp_mask), size))
532 return -EFAULT;
533 }
534 if (new_nodes) {
535 if (compat_get_bitmap(nodes_addr(tmp_mask), new_nodes, nr_bits))
536 return -EFAULT;
537 if (new == NULL)
538 new = compat_alloc_user_space(size);
539 if (copy_to_user(new, nodes_addr(tmp_mask), size))
540 return -EFAULT;
541 }
542 return sys_migrate_pages(pid, nr_bits + 1, old, new);
543}
544#endif
545
546/* 491/*
547 * Allocate user-space memory for the duration of a single system call, 492 * Allocate user-space memory for the duration of a single system call,
548 * in order to marshall parameters inside a compat thunk. 493 * in order to marshall parameters inside a compat thunk.