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' into master (patches from Andrew)

Merge misc fixes from Andrew Morton:
"Subsystems affected by this patch series: mm/pagemap, mm/shmem,
mm/hotfixes, mm/memcg, mm/hugetlb, mailmap, squashfs, scripts,
io-mapping, MAINTAINERS, and gdb"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
scripts/gdb: fix lx-symbols 'gdb.error' while loading modules
MAINTAINERS: add KCOV section
io-mapping: indicate mapping failure
scripts/decode_stacktrace: strip basepath from all paths
squashfs: fix length field overlap check in metadata reading
mailmap: add entry for Mike Rapoport
khugepaged: fix null-pointer dereference due to race
mm/hugetlb: avoid hardcoding while checking if cma is enabled
mm: memcg/slab: fix memory leak at non-root kmem_cache destroy
mm/memcg: fix refcount error while moving and swapping
mm/memcontrol: fix OOPS inside mem_cgroup_get_nr_swap_pages()
mm: initialize return of vm_insert_pages
vfs/xattr: mm/shmem: kernfs: release simple xattr entry in a right way
mm/mmap.c: close race between munmap() and expand_upwards()/downwards()

+91 -25
+3
.mailmap
··· 198 198 Mayuresh Janorkar <mayur@ti.com> 199 199 Michael Buesch <m@bues.ch> 200 200 Michel Dänzer <michel@tungstengraphics.com> 201 + Mike Rapoport <rppt@kernel.org> <mike@compulab.co.il> 202 + Mike Rapoport <rppt@kernel.org> <mike.rapoport@gmail.com> 203 + Mike Rapoport <rppt@kernel.org> <rppt@linux.ibm.com> 201 204 Miodrag Dinic <miodrag.dinic@mips.com> <miodrag.dinic@imgtec.com> 202 205 Miquel Raynal <miquel.raynal@bootlin.com> <miquel.raynal@free-electrons.com> 203 206 Mitesh shah <mshah@teja.com>
+11
MAINTAINERS
··· 9306 9306 F: scripts/Kconfig.include 9307 9307 F: scripts/kconfig/ 9308 9308 9309 + KCOV 9310 + R: Dmitry Vyukov <dvyukov@google.com> 9311 + R: Andrey Konovalov <andreyknvl@google.com> 9312 + L: kasan-dev@googlegroups.com 9313 + S: Maintained 9314 + F: Documentation/dev-tools/kcov.rst 9315 + F: include/linux/kcov.h 9316 + F: include/uapi/linux/kcov.h 9317 + F: kernel/kcov.c 9318 + F: scripts/Makefile.kcov 9319 + 9309 9320 KCSAN 9310 9321 M: Marco Elver <elver@google.com> 9311 9322 R: Dmitry Vyukov <dvyukov@google.com>
+1 -1
fs/squashfs/block.c
··· 175 175 /* Extract the length of the metadata block */ 176 176 data = page_address(bvec->bv_page) + bvec->bv_offset; 177 177 length = data[offset]; 178 - if (offset <= bvec->bv_len - 1) { 178 + if (offset < bvec->bv_len - 1) { 179 179 length |= data[offset + 1] << 8; 180 180 } else { 181 181 if (WARN_ON_ONCE(!bio_next_segment(bio, &iter_all))) {
+4 -1
include/linux/io-mapping.h
··· 107 107 resource_size_t base, 108 108 unsigned long size) 109 109 { 110 + iomap->iomem = ioremap_wc(base, size); 111 + if (!iomap->iomem) 112 + return NULL; 113 + 110 114 iomap->base = base; 111 115 iomap->size = size; 112 - iomap->iomem = ioremap_wc(base, size); 113 116 #if defined(pgprot_noncached_wc) /* archs can't agree on a name ... */ 114 117 iomap->prot = pgprot_noncached_wc(PAGE_KERNEL); 115 118 #elif defined(pgprot_writecombine)
+2 -1
include/linux/xattr.h
··· 15 15 #include <linux/slab.h> 16 16 #include <linux/types.h> 17 17 #include <linux/spinlock.h> 18 + #include <linux/mm.h> 18 19 #include <uapi/linux/xattr.h> 19 20 20 21 struct inode; ··· 95 94 96 95 list_for_each_entry_safe(xattr, node, &xattrs->head, list) { 97 96 kfree(xattr->name); 98 - kfree(xattr); 97 + kvfree(xattr); 99 98 } 100 99 } 101 100
+10 -5
mm/hugetlb.c
··· 45 45 unsigned int default_hstate_idx; 46 46 struct hstate hstates[HUGE_MAX_HSTATE]; 47 47 48 + #ifdef CONFIG_CMA 48 49 static struct cma *hugetlb_cma[MAX_NUMNODES]; 50 + #endif 51 + static unsigned long hugetlb_cma_size __initdata; 49 52 50 53 /* 51 54 * Minimum page order among possible hugepage sizes, set to a proper value ··· 1238 1235 * If the page isn't allocated using the cma allocator, 1239 1236 * cma_release() returns false. 1240 1237 */ 1241 - if (IS_ENABLED(CONFIG_CMA) && 1242 - cma_release(hugetlb_cma[page_to_nid(page)], page, 1 << order)) 1238 + #ifdef CONFIG_CMA 1239 + if (cma_release(hugetlb_cma[page_to_nid(page)], page, 1 << order)) 1243 1240 return; 1241 + #endif 1244 1242 1245 1243 free_contig_range(page_to_pfn(page), 1 << order); 1246 1244 } ··· 1252 1248 { 1253 1249 unsigned long nr_pages = 1UL << huge_page_order(h); 1254 1250 1255 - if (IS_ENABLED(CONFIG_CMA)) { 1251 + #ifdef CONFIG_CMA 1252 + { 1256 1253 struct page *page; 1257 1254 int node; 1258 1255 ··· 1267 1262 return page; 1268 1263 } 1269 1264 } 1265 + #endif 1270 1266 1271 1267 return alloc_contig_pages(nr_pages, gfp_mask, nid, nodemask); 1272 1268 } ··· 2577 2571 2578 2572 for (i = 0; i < h->max_huge_pages; ++i) { 2579 2573 if (hstate_is_gigantic(h)) { 2580 - if (IS_ENABLED(CONFIG_CMA) && hugetlb_cma[0]) { 2574 + if (hugetlb_cma_size) { 2581 2575 pr_warn_once("HugeTLB: hugetlb_cma is enabled, skip boot time allocation\n"); 2582 2576 break; 2583 2577 } ··· 5660 5654 } 5661 5655 5662 5656 #ifdef CONFIG_CMA 5663 - static unsigned long hugetlb_cma_size __initdata; 5664 5657 static bool cma_reserve_called __initdata; 5665 5658 5666 5659 static int __init cmdline_parse_hugetlb_cma(char *p)
+3
mm/khugepaged.c
··· 958 958 return SCAN_ADDRESS_RANGE; 959 959 if (!hugepage_vma_check(vma, vma->vm_flags)) 960 960 return SCAN_VMA_CHECK; 961 + /* Anon VMA expected */ 962 + if (!vma->anon_vma || vma->vm_ops) 963 + return SCAN_VMA_CHECK; 961 964 return 0; 962 965 } 963 966
+10 -3
mm/memcontrol.c
··· 5669 5669 if (!mem_cgroup_is_root(mc.to)) 5670 5670 page_counter_uncharge(&mc.to->memory, mc.moved_swap); 5671 5671 5672 - mem_cgroup_id_get_many(mc.to, mc.moved_swap); 5673 5672 css_put_many(&mc.to->css, mc.moved_swap); 5674 5673 5675 5674 mc.moved_swap = 0; ··· 5859 5860 ent = target.ent; 5860 5861 if (!mem_cgroup_move_swap_account(ent, mc.from, mc.to)) { 5861 5862 mc.precharge--; 5862 - /* we fixup refcnts and charges later. */ 5863 + mem_cgroup_id_get_many(mc.to, 1); 5864 + /* we fixup other refcnts and charges later. */ 5863 5865 mc.moved_swap++; 5864 5866 } 5865 5867 break; ··· 7186 7186 { }, /* terminate */ 7187 7187 }; 7188 7188 7189 + /* 7190 + * If mem_cgroup_swap_init() is implemented as a subsys_initcall() 7191 + * instead of a core_initcall(), this could mean cgroup_memory_noswap still 7192 + * remains set to false even when memcg is disabled via "cgroup_disable=memory" 7193 + * boot parameter. This may result in premature OOPS inside 7194 + * mem_cgroup_get_nr_swap_pages() function in corner cases. 7195 + */ 7189 7196 static int __init mem_cgroup_swap_init(void) 7190 7197 { 7191 7198 /* No memory control -> no swap control */ ··· 7207 7200 7208 7201 return 0; 7209 7202 } 7210 - subsys_initcall(mem_cgroup_swap_init); 7203 + core_initcall(mem_cgroup_swap_init); 7211 7204 7212 7205 #endif /* CONFIG_MEMCG_SWAP */
+1 -1
mm/memory.c
··· 1601 1601 return insert_pages(vma, addr, pages, num, vma->vm_page_prot); 1602 1602 #else 1603 1603 unsigned long idx = 0, pgcount = *num; 1604 - int err; 1604 + int err = -EINVAL; 1605 1605 1606 1606 for (; idx < pgcount; ++idx) { 1607 1607 err = vm_insert_page(vma, addr + (PAGE_SIZE * idx), pages[idx]);
+14 -2
mm/mmap.c
··· 2620 2620 * Create a list of vma's touched by the unmap, removing them from the mm's 2621 2621 * vma list as we go.. 2622 2622 */ 2623 - static void 2623 + static bool 2624 2624 detach_vmas_to_be_unmapped(struct mm_struct *mm, struct vm_area_struct *vma, 2625 2625 struct vm_area_struct *prev, unsigned long end) 2626 2626 { ··· 2645 2645 2646 2646 /* Kill the cache */ 2647 2647 vmacache_invalidate(mm); 2648 + 2649 + /* 2650 + * Do not downgrade mmap_lock if we are next to VM_GROWSDOWN or 2651 + * VM_GROWSUP VMA. Such VMAs can change their size under 2652 + * down_read(mmap_lock) and collide with the VMA we are about to unmap. 2653 + */ 2654 + if (vma && (vma->vm_flags & VM_GROWSDOWN)) 2655 + return false; 2656 + if (prev && (prev->vm_flags & VM_GROWSUP)) 2657 + return false; 2658 + return true; 2648 2659 } 2649 2660 2650 2661 /* ··· 2836 2825 } 2837 2826 2838 2827 /* Detach vmas from rbtree */ 2839 - detach_vmas_to_be_unmapped(mm, vma, prev, end); 2828 + if (!detach_vmas_to_be_unmapped(mm, vma, prev, end)) 2829 + downgrade = false; 2840 2830 2841 2831 if (downgrade) 2842 2832 mmap_write_downgrade(mm);
+1 -1
mm/shmem.c
··· 3178 3178 new_xattr->name = kmalloc(XATTR_SECURITY_PREFIX_LEN + len, 3179 3179 GFP_KERNEL); 3180 3180 if (!new_xattr->name) { 3181 - kfree(new_xattr); 3181 + kvfree(new_xattr); 3182 3182 return -ENOMEM; 3183 3183 } 3184 3184
+28 -7
mm/slab_common.c
··· 326 326 if (s->refcount < 0) 327 327 return 1; 328 328 329 + #ifdef CONFIG_MEMCG_KMEM 330 + /* 331 + * Skip the dying kmem_cache. 332 + */ 333 + if (s->memcg_params.dying) 334 + return 1; 335 + #endif 336 + 329 337 return 0; 330 338 } 331 339 ··· 894 886 return 0; 895 887 } 896 888 897 - static void flush_memcg_workqueue(struct kmem_cache *s) 889 + static void memcg_set_kmem_cache_dying(struct kmem_cache *s) 898 890 { 899 891 spin_lock_irq(&memcg_kmem_wq_lock); 900 892 s->memcg_params.dying = true; 901 893 spin_unlock_irq(&memcg_kmem_wq_lock); 894 + } 902 895 896 + static void flush_memcg_workqueue(struct kmem_cache *s) 897 + { 903 898 /* 904 899 * SLAB and SLUB deactivate the kmem_caches through call_rcu. Make 905 900 * sure all registered rcu callbacks have been invoked. ··· 934 923 { 935 924 return 0; 936 925 } 937 - 938 - static inline void flush_memcg_workqueue(struct kmem_cache *s) 939 - { 940 - } 941 926 #endif /* CONFIG_MEMCG_KMEM */ 942 927 943 928 void slab_kmem_cache_release(struct kmem_cache *s) ··· 951 944 if (unlikely(!s)) 952 945 return; 953 946 954 - flush_memcg_workqueue(s); 955 - 956 947 get_online_cpus(); 957 948 get_online_mems(); 958 949 ··· 959 954 s->refcount--; 960 955 if (s->refcount) 961 956 goto out_unlock; 957 + 958 + #ifdef CONFIG_MEMCG_KMEM 959 + memcg_set_kmem_cache_dying(s); 960 + 961 + mutex_unlock(&slab_mutex); 962 + 963 + put_online_mems(); 964 + put_online_cpus(); 965 + 966 + flush_memcg_workqueue(s); 967 + 968 + get_online_cpus(); 969 + get_online_mems(); 970 + 971 + mutex_lock(&slab_mutex); 972 + #endif 962 973 963 974 err = shutdown_memcg_caches(s); 964 975 if (!err)
+2 -2
scripts/decode_stacktrace.sh
··· 87 87 return 88 88 fi 89 89 90 - # Strip out the base of the path 91 - code=${code#$basepath/} 90 + # Strip out the base of the path on each line 91 + code=$(while read -r line; do echo "${line#$basepath/}"; done <<< "$code") 92 92 93 93 # In the case of inlines, move everything to same line 94 94 code=${code//$'\n'/' '}
+1 -1
scripts/gdb/linux/symbols.py
··· 96 96 return "" 97 97 attrs = sect_attrs['attrs'] 98 98 section_name_to_address = { 99 - attrs[n]['name'].string(): attrs[n]['address'] 99 + attrs[n]['battr']['attr']['name'].string(): attrs[n]['address'] 100 100 for n in range(int(sect_attrs['nsections']))} 101 101 args = [] 102 102 for section_name in [".data", ".data..read_mostly", ".rodata", ".bss",