Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'akpm' (patches from Andrew)

Merge misc fixes from Andrew Morton:
"12 patches.

Subsystems affected by this patch series: MAINTAINERS, mailmap, memfd,
and mm (hugetlb, kasan, hugetlbfs, pagemap, selftests, memcg, and
slab)"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
selftests/memfd: clean up mapping in mfd_fail_write
mailmap: update Roman Gushchin's email
MAINTAINERS, SLAB: add Roman as reviewer, git tree
MAINTAINERS: add Shakeel as a memcg co-maintainer
MAINTAINERS: remove Vladimir from memcg maintainers
MAINTAINERS: add Roman as a memcg co-maintainer
selftest/vm: fix map_fixed_noreplace test failure
mm: fix use-after-free bug when mm->mmap is reused after being freed
hugetlbfs: fix a truncation issue in hugepages parameter
kasan: test: prevent cache merging in kmem_cache_double_destroy
mm/hugetlb: fix kernel crash with hugetlb mremap
MAINTAINERS: add sysctl-next git tree

+56 -20
+3
.mailmap
··· 333 333 Ricardo Ribalda <ribalda@kernel.org> <ricardo@ribalda.com> 334 334 Ricardo Ribalda <ribalda@kernel.org> Ricardo Ribalda Delgado <ribalda@kernel.org> 335 335 Ricardo Ribalda <ribalda@kernel.org> <ricardo.ribalda@gmail.com> 336 + Roman Gushchin <roman.gushchin@linux.dev> <guro@fb.com> 337 + Roman Gushchin <roman.gushchin@linux.dev> <guroan@gmail.com> 338 + Roman Gushchin <roman.gushchin@linux.dev> <klamm@yandex-team.ru> 336 339 Ross Zwisler <zwisler@kernel.org> <ross.zwisler@linux.intel.com> 337 340 Rudolf Marek <R.Marek@sh.cvut.cz> 338 341 Rui Saraiva <rmps@joel.ist.utl.pt>
+5 -1
MAINTAINERS
··· 4913 4913 CONTROL GROUP - MEMORY RESOURCE CONTROLLER (MEMCG) 4914 4914 M: Johannes Weiner <hannes@cmpxchg.org> 4915 4915 M: Michal Hocko <mhocko@kernel.org> 4916 - M: Vladimir Davydov <vdavydov.dev@gmail.com> 4916 + M: Roman Gushchin <roman.gushchin@linux.dev> 4917 + M: Shakeel Butt <shakeelb@google.com> 4917 4918 L: cgroups@vger.kernel.org 4918 4919 L: linux-mm@kvack.org 4919 4920 S: Maintained ··· 15568 15567 L: linux-kernel@vger.kernel.org 15569 15568 L: linux-fsdevel@vger.kernel.org 15570 15569 S: Maintained 15570 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git sysctl-next 15571 15571 F: fs/proc/proc_sysctl.c 15572 15572 F: include/linux/sysctl.h 15573 15573 F: kernel/sysctl-test.c ··· 17762 17760 M: Joonsoo Kim <iamjoonsoo.kim@lge.com> 17763 17761 M: Andrew Morton <akpm@linux-foundation.org> 17764 17762 M: Vlastimil Babka <vbabka@suse.cz> 17763 + R: Roman Gushchin <roman.gushchin@linux.dev> 17765 17764 L: linux-mm@kvack.org 17766 17765 S: Maintained 17766 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab.git 17767 17767 F: include/linux/sl?b*.h 17768 17768 F: mm/sl?b* 17769 17769
+4 -1
lib/test_kasan.c
··· 869 869 kmem_cache_destroy(cache); 870 870 } 871 871 872 + static void empty_cache_ctor(void *object) { } 873 + 872 874 static void kmem_cache_double_destroy(struct kunit *test) 873 875 { 874 876 struct kmem_cache *cache; 875 877 876 - cache = kmem_cache_create("test_cache", 200, 0, 0, NULL); 878 + /* Provide a constructor to prevent cache merging. */ 879 + cache = kmem_cache_create("test_cache", 200, 0, 0, empty_cache_ctor); 877 880 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, cache); 878 881 kmem_cache_destroy(cache); 879 882 KUNIT_EXPECT_KASAN_FAIL(test, kmem_cache_destroy(cache));
+5 -6
mm/hugetlb.c
··· 4159 4159 pr_warn("HugeTLB: architecture can't support node specific alloc, ignoring!\n"); 4160 4160 return 0; 4161 4161 } 4162 + if (tmp >= nr_online_nodes) 4163 + goto invalid; 4162 4164 node = tmp; 4163 4165 p += count + 1; 4164 - if (node < 0 || node >= nr_online_nodes) 4165 - goto invalid; 4166 4166 /* Parse hugepages */ 4167 4167 if (sscanf(p, "%lu%n", &tmp, &count) != 1) 4168 4168 goto invalid; ··· 4851 4851 } 4852 4852 4853 4853 static void move_huge_pte(struct vm_area_struct *vma, unsigned long old_addr, 4854 - unsigned long new_addr, pte_t *src_pte) 4854 + unsigned long new_addr, pte_t *src_pte, pte_t *dst_pte) 4855 4855 { 4856 4856 struct hstate *h = hstate_vma(vma); 4857 4857 struct mm_struct *mm = vma->vm_mm; 4858 - pte_t *dst_pte, pte; 4859 4858 spinlock_t *src_ptl, *dst_ptl; 4859 + pte_t pte; 4860 4860 4861 - dst_pte = huge_pte_offset(mm, new_addr, huge_page_size(h)); 4862 4861 dst_ptl = huge_pte_lock(h, mm, dst_pte); 4863 4862 src_ptl = huge_pte_lockptr(h, mm, src_pte); 4864 4863 ··· 4916 4917 if (!dst_pte) 4917 4918 break; 4918 4919 4919 - move_huge_pte(vma, old_addr, new_addr, src_pte); 4920 + move_huge_pte(vma, old_addr, new_addr, src_pte, dst_pte); 4920 4921 } 4921 4922 flush_tlb_range(vma, old_end - len, old_end); 4922 4923 mmu_notifier_invalidate_range_end(&range);
+1
mm/mmap.c
··· 3186 3186 vma = remove_vma(vma); 3187 3187 cond_resched(); 3188 3188 } 3189 + mm->mmap = NULL; 3189 3190 mmap_write_unlock(mm); 3190 3191 vm_unacct_memory(nr_accounted); 3191 3192 }
+1
tools/testing/selftests/memfd/memfd_test.c
··· 455 455 printf("mmap()+mprotect() didn't fail as expected\n"); 456 456 abort(); 457 457 } 458 + munmap(p, mfd_def_size); 458 459 } 459 460 460 461 /* verify PUNCH_HOLE fails */
+37 -12
tools/testing/selftests/vm/map_fixed_noreplace.c
··· 17 17 #define MAP_FIXED_NOREPLACE 0x100000 18 18 #endif 19 19 20 - #define BASE_ADDRESS (256ul * 1024 * 1024) 21 - 22 - 23 20 static void dump_maps(void) 24 21 { 25 22 char cmd[32]; ··· 25 28 system(cmd); 26 29 } 27 30 31 + static unsigned long find_base_addr(unsigned long size) 32 + { 33 + void *addr; 34 + unsigned long flags; 35 + 36 + flags = MAP_PRIVATE | MAP_ANONYMOUS; 37 + addr = mmap(NULL, size, PROT_NONE, flags, -1, 0); 38 + if (addr == MAP_FAILED) { 39 + printf("Error: couldn't map the space we need for the test\n"); 40 + return 0; 41 + } 42 + 43 + if (munmap(addr, size) != 0) { 44 + printf("Error: couldn't map the space we need for the test\n"); 45 + return 0; 46 + } 47 + return (unsigned long)addr; 48 + } 49 + 28 50 int main(void) 29 51 { 52 + unsigned long base_addr; 30 53 unsigned long flags, addr, size, page_size; 31 54 char *p; 32 55 33 56 page_size = sysconf(_SC_PAGE_SIZE); 34 57 58 + //let's find a base addr that is free before we start the tests 59 + size = 5 * page_size; 60 + base_addr = find_base_addr(size); 61 + if (!base_addr) { 62 + printf("Error: couldn't map the space we need for the test\n"); 63 + return 1; 64 + } 65 + 35 66 flags = MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED_NOREPLACE; 36 67 37 68 // Check we can map all the areas we need below 38 69 errno = 0; 39 - addr = BASE_ADDRESS; 70 + addr = base_addr; 40 71 size = 5 * page_size; 41 72 p = mmap((void *)addr, size, PROT_NONE, flags, -1, 0); 42 73 ··· 85 60 printf("unmap() successful\n"); 86 61 87 62 errno = 0; 88 - addr = BASE_ADDRESS + page_size; 63 + addr = base_addr + page_size; 89 64 size = 3 * page_size; 90 65 p = mmap((void *)addr, size, PROT_NONE, flags, -1, 0); 91 66 printf("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); ··· 105 80 * +4 | free | new 106 81 */ 107 82 errno = 0; 108 - addr = BASE_ADDRESS; 83 + addr = base_addr; 109 84 size = 5 * page_size; 110 85 p = mmap((void *)addr, size, PROT_NONE, flags, -1, 0); 111 86 printf("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); ··· 126 101 * +4 | free | 127 102 */ 128 103 errno = 0; 129 - addr = BASE_ADDRESS + (2 * page_size); 104 + addr = base_addr + (2 * page_size); 130 105 size = page_size; 131 106 p = mmap((void *)addr, size, PROT_NONE, flags, -1, 0); 132 107 printf("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); ··· 146 121 * +4 | free | new 147 122 */ 148 123 errno = 0; 149 - addr = BASE_ADDRESS + (3 * page_size); 124 + addr = base_addr + (3 * page_size); 150 125 size = 2 * page_size; 151 126 p = mmap((void *)addr, size, PROT_NONE, flags, -1, 0); 152 127 printf("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); ··· 166 141 * +4 | free | 167 142 */ 168 143 errno = 0; 169 - addr = BASE_ADDRESS; 144 + addr = base_addr; 170 145 size = 2 * page_size; 171 146 p = mmap((void *)addr, size, PROT_NONE, flags, -1, 0); 172 147 printf("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); ··· 186 161 * +4 | free | 187 162 */ 188 163 errno = 0; 189 - addr = BASE_ADDRESS; 164 + addr = base_addr; 190 165 size = page_size; 191 166 p = mmap((void *)addr, size, PROT_NONE, flags, -1, 0); 192 167 printf("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); ··· 206 181 * +4 | free | new 207 182 */ 208 183 errno = 0; 209 - addr = BASE_ADDRESS + (4 * page_size); 184 + addr = base_addr + (4 * page_size); 210 185 size = page_size; 211 186 p = mmap((void *)addr, size, PROT_NONE, flags, -1, 0); 212 187 printf("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); ··· 217 192 return 1; 218 193 } 219 194 220 - addr = BASE_ADDRESS; 195 + addr = base_addr; 221 196 size = 5 * page_size; 222 197 if (munmap((void *)addr, size) != 0) { 223 198 dump_maps();