diff options
author | Andrew Morton | 2023-10-18 14:32:58 -0700 |
---|---|---|
committer | Andrew Morton | 2023-10-18 14:32:58 -0700 |
commit | 5ef8f1b2b4d9bd02e4104b9255351fb9279b1b4e (patch) | |
tree | 415dc49e56338e498bff9a3b0c5b99b049890e14 /mm/migrate.c | |
parent | b0540208a59e11ab55c9b857bf521d8846e515bf (diff) | |
parent | fc7f04dc23db50206bee7891516ed4726c3f64cf (diff) |
Merge mm-hotfixes-stable into mm-stable to pick up depended-upon changes.
Diffstat (limited to 'mm/migrate.c')
-rw-r--r-- | mm/migrate.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/mm/migrate.c b/mm/migrate.c index 942f8c9cd068..482f478ea3fe 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -2155,6 +2155,7 @@ static int do_pages_move(struct mm_struct *mm, nodemask_t task_nodes, const int __user *nodes, int __user *status, int flags) { + compat_uptr_t __user *compat_pages = (void __user *)pages; int current_node = NUMA_NO_NODE; LIST_HEAD(pagelist); int start, i; @@ -2167,8 +2168,17 @@ static int do_pages_move(struct mm_struct *mm, nodemask_t task_nodes, int node; err = -EFAULT; - if (get_user(p, pages + i)) - goto out_flush; + if (in_compat_syscall()) { + compat_uptr_t cp; + + if (get_user(cp, compat_pages + i)) + goto out_flush; + + p = compat_ptr(cp); + } else { + if (get_user(p, pages + i)) + goto out_flush; + } if (get_user(node, nodes + i)) goto out_flush; |