Commit 4806364a authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'mm-hotfixes-stable-2023-07-18-12-28' of...

Merge tag 'mm-hotfixes-stable-2023-07-18-12-28' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull hotfixes from Andrew Morton:
 "Seven hotfixes, six of which are cc:stable and one of which addresses
  a post-6.5 issue"

* tag 'mm-hotfixes-stable-2023-07-18-12-28' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
  maple_tree: fix node allocation testing on 32 bit
  maple_tree: fix 32 bit mas_next testing
  selftests/mm: mkdirty: fix incorrect position of #endif
  maple_tree: set the node limit when creating a new root node
  mm/mlock: fix vma iterator conversion of apply_vma_lock_flags()
  prctl: move PR_GET_AUXV out of PR_MCE_KILL
  selftests/mm: give scripts execute permission
parents 74f1456c ef5c3de5
...@@ -2535,11 +2535,6 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, ...@@ -2535,11 +2535,6 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
else else
return -EINVAL; return -EINVAL;
break; break;
case PR_GET_AUXV:
if (arg4 || arg5)
return -EINVAL;
error = prctl_get_auxv((void __user *)arg2, arg3);
break;
default: default:
return -EINVAL; return -EINVAL;
} }
...@@ -2694,6 +2689,11 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, ...@@ -2694,6 +2689,11 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
case PR_SET_VMA: case PR_SET_VMA:
error = prctl_set_vma(arg2, arg3, arg4, arg5); error = prctl_set_vma(arg2, arg3, arg4, arg5);
break; break;
case PR_GET_AUXV:
if (arg4 || arg5)
return -EINVAL;
error = prctl_get_auxv((void __user *)arg2, arg3);
break;
#ifdef CONFIG_KSM #ifdef CONFIG_KSM
case PR_SET_MEMORY_MERGE: case PR_SET_MEMORY_MERGE:
if (arg3 || arg4 || arg5) if (arg3 || arg4 || arg5)
......
...@@ -3692,7 +3692,8 @@ static inline int mas_root_expand(struct ma_state *mas, void *entry) ...@@ -3692,7 +3692,8 @@ static inline int mas_root_expand(struct ma_state *mas, void *entry)
mas->offset = slot; mas->offset = slot;
pivots[slot] = mas->last; pivots[slot] = mas->last;
if (mas->last != ULONG_MAX) if (mas->last != ULONG_MAX)
slot++; pivots[++slot] = ULONG_MAX;
mas->depth = 1; mas->depth = 1;
mas_set_height(mas); mas_set_height(mas);
ma_set_meta(node, maple_leaf_64, 0, slot); ma_set_meta(node, maple_leaf_64, 0, slot);
......
...@@ -1898,13 +1898,16 @@ static noinline void __init next_prev_test(struct maple_tree *mt) ...@@ -1898,13 +1898,16 @@ static noinline void __init next_prev_test(struct maple_tree *mt)
725}; 725};
static const unsigned long level2_32[] = { 1747, 2000, 1750, 1755, static const unsigned long level2_32[] = { 1747, 2000, 1750, 1755,
1760, 1765}; 1760, 1765};
unsigned long last_index;
if (MAPLE_32BIT) { if (MAPLE_32BIT) {
nr_entries = 500; nr_entries = 500;
level2 = level2_32; level2 = level2_32;
last_index = 0x138e;
} else { } else {
nr_entries = 200; nr_entries = 200;
level2 = level2_64; level2 = level2_64;
last_index = 0x7d6;
} }
for (i = 0; i <= nr_entries; i++) for (i = 0; i <= nr_entries; i++)
...@@ -2011,7 +2014,7 @@ static noinline void __init next_prev_test(struct maple_tree *mt) ...@@ -2011,7 +2014,7 @@ static noinline void __init next_prev_test(struct maple_tree *mt)
val = mas_next(&mas, ULONG_MAX); val = mas_next(&mas, ULONG_MAX);
MT_BUG_ON(mt, val != NULL); MT_BUG_ON(mt, val != NULL);
MT_BUG_ON(mt, mas.index != 0x7d6); MT_BUG_ON(mt, mas.index != last_index);
MT_BUG_ON(mt, mas.last != ULONG_MAX); MT_BUG_ON(mt, mas.last != ULONG_MAX);
val = mas_prev(&mas, 0); val = mas_prev(&mas, 0);
......
...@@ -477,7 +477,6 @@ static int apply_vma_lock_flags(unsigned long start, size_t len, ...@@ -477,7 +477,6 @@ static int apply_vma_lock_flags(unsigned long start, size_t len,
{ {
unsigned long nstart, end, tmp; unsigned long nstart, end, tmp;
struct vm_area_struct *vma, *prev; struct vm_area_struct *vma, *prev;
int error;
VMA_ITERATOR(vmi, current->mm, start); VMA_ITERATOR(vmi, current->mm, start);
VM_BUG_ON(offset_in_page(start)); VM_BUG_ON(offset_in_page(start));
...@@ -498,6 +497,7 @@ static int apply_vma_lock_flags(unsigned long start, size_t len, ...@@ -498,6 +497,7 @@ static int apply_vma_lock_flags(unsigned long start, size_t len,
nstart = start; nstart = start;
tmp = vma->vm_start; tmp = vma->vm_start;
for_each_vma_range(vmi, vma, end) { for_each_vma_range(vmi, vma, end) {
int error;
vm_flags_t newflags; vm_flags_t newflags;
if (vma->vm_start != tmp) if (vma->vm_start != tmp)
...@@ -511,14 +511,15 @@ static int apply_vma_lock_flags(unsigned long start, size_t len, ...@@ -511,14 +511,15 @@ static int apply_vma_lock_flags(unsigned long start, size_t len,
tmp = end; tmp = end;
error = mlock_fixup(&vmi, vma, &prev, nstart, tmp, newflags); error = mlock_fixup(&vmi, vma, &prev, nstart, tmp, newflags);
if (error) if (error)
break; return error;
tmp = vma_iter_end(&vmi);
nstart = tmp; nstart = tmp;
} }
if (vma_iter_end(&vmi) < end) if (tmp < end)
return -ENOMEM; return -ENOMEM;
return error; return 0;
} }
/* /*
......
...@@ -206,9 +206,9 @@ static noinline void __init check_new_node(struct maple_tree *mt) ...@@ -206,9 +206,9 @@ static noinline void __init check_new_node(struct maple_tree *mt)
e = i - 1; e = i - 1;
} else { } else {
if (i >= 4) if (i >= 4)
e = i - 4; e = i - 3;
else if (i == 3) else if (i >= 1)
e = i - 2; e = i - 1;
else else
e = 0; e = 0;
} }
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
...@@ -321,8 +321,8 @@ static void test_uffdio_copy(void) ...@@ -321,8 +321,8 @@ static void test_uffdio_copy(void)
munmap: munmap:
munmap(dst, pagesize); munmap(dst, pagesize);
free(src); free(src);
#endif /* __NR_userfaultfd */
} }
#endif /* __NR_userfaultfd */
int main(void) int main(void)
{ {
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment