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:
"11 fixes"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
kvm, mm: account shadow page tables to kmemcg
zswap: re-check zswap_is_full() after do zswap_shrink()
include/linux/eventfd.h: include linux/errno.h
mm: fix vma_is_anonymous() false-positives
mm: use vma_init() to initialize VMAs on stack and data segments
mm: introduce vma_init()
mm: fix exports that inadvertently make put_page() EXPORT_SYMBOL_GPL
ipc/sem.c: prevent queue.status tearing in semop
mm: disallow mappings that conflict for devm_memremap_pages()
kasan: only select SLUB_DEBUG with SYSFS=y
delayacct: fix crash in delayacct_blkio_end() after delayacct init failure

+73 -18
+1
arch/arm/kernel/process.c
··· 338 338 339 339 static int __init gate_vma_init(void) 340 340 { 341 + vma_init(&gate_vma, NULL); 341 342 gate_vma.vm_page_prot = PAGE_READONLY_EXEC; 342 343 return 0; 343 344 }
+1 -1
arch/arm/mach-rpc/ecard.c
··· 237 237 238 238 memcpy(dst_pgd, src_pgd, sizeof(pgd_t) * (EASI_SIZE / PGDIR_SIZE)); 239 239 240 + vma_init(&vma, mm); 240 241 vma.vm_flags = VM_EXEC; 241 - vma.vm_mm = mm; 242 242 243 243 flush_tlb_range(&vma, IO_START, IO_START + IO_SIZE); 244 244 flush_tlb_range(&vma, EASI_START, EASI_START + EASI_SIZE);
+3 -1
arch/arm64/include/asm/tlb.h
··· 37 37 38 38 static inline void tlb_flush(struct mmu_gather *tlb) 39 39 { 40 - struct vm_area_struct vma = { .vm_mm = tlb->mm, }; 40 + struct vm_area_struct vma; 41 + 42 + vma_init(&vma, tlb->mm); 41 43 42 44 /* 43 45 * The ASID allocator will either invalidate the ASID or mark
+5 -2
arch/arm64/mm/hugetlbpage.c
··· 108 108 unsigned long pgsize, 109 109 unsigned long ncontig) 110 110 { 111 - struct vm_area_struct vma = { .vm_mm = mm }; 111 + struct vm_area_struct vma; 112 112 pte_t orig_pte = huge_ptep_get(ptep); 113 113 bool valid = pte_valid(orig_pte); 114 114 unsigned long i, saddr = addr; 115 + 116 + vma_init(&vma, mm); 115 117 116 118 for (i = 0; i < ncontig; i++, addr += pgsize, ptep++) { 117 119 pte_t pte = ptep_get_and_clear(mm, addr, ptep); ··· 147 145 unsigned long pgsize, 148 146 unsigned long ncontig) 149 147 { 150 - struct vm_area_struct vma = { .vm_mm = mm }; 148 + struct vm_area_struct vma; 151 149 unsigned long i, saddr = addr; 152 150 151 + vma_init(&vma, mm); 153 152 for (i = 0; i < ncontig; i++, addr += pgsize, ptep++) 154 153 pte_clear(mm, addr, ptep); 155 154
+1 -1
arch/ia64/include/asm/tlb.h
··· 120 120 */ 121 121 struct vm_area_struct vma; 122 122 123 - vma.vm_mm = tlb->mm; 123 + vma_init(&vma, tlb->mm); 124 124 /* flush the address range from the tlb: */ 125 125 flush_tlb_range(&vma, start, end); 126 126 /* now flush the virt. page-table area mapping the address range: */
+1 -1
arch/ia64/mm/init.c
··· 273 273 274 274 static int __init gate_vma_init(void) 275 275 { 276 - gate_vma.vm_mm = NULL; 276 + vma_init(&gate_vma, NULL); 277 277 gate_vma.vm_start = FIXADDR_USER_START; 278 278 gate_vma.vm_end = FIXADDR_USER_END; 279 279 gate_vma.vm_flags = VM_READ | VM_MAYREAD | VM_EXEC | VM_MAYEXEC;
+1 -1
arch/x86/kvm/mmu.c
··· 890 890 if (cache->nobjs >= min) 891 891 return 0; 892 892 while (cache->nobjs < ARRAY_SIZE(cache->objects)) { 893 - page = (void *)__get_free_page(GFP_KERNEL); 893 + page = (void *)__get_free_page(GFP_KERNEL_ACCOUNT); 894 894 if (!page) 895 895 return -ENOMEM; 896 896 cache->objects[cache->nobjs++] = page;
+1 -1
arch/x86/um/mem_32.c
··· 16 16 if (!FIXADDR_USER_START) 17 17 return 0; 18 18 19 - gate_vma.vm_mm = NULL; 19 + vma_init(&gate_vma, NULL); 20 20 gate_vma.vm_start = FIXADDR_USER_START; 21 21 gate_vma.vm_end = FIXADDR_USER_END; 22 22 gate_vma.vm_flags = VM_READ | VM_MAYREAD | VM_EXEC | VM_MAYEXEC;
+1
drivers/char/mem.c
··· 708 708 #endif 709 709 if (vma->vm_flags & VM_SHARED) 710 710 return shmem_zero_setup(vma); 711 + vma_set_anonymous(vma); 711 712 return 0; 712 713 } 713 714
+1
fs/exec.c
··· 293 293 bprm->vma = vma = vm_area_alloc(mm); 294 294 if (!vma) 295 295 return -ENOMEM; 296 + vma_set_anonymous(vma); 296 297 297 298 if (down_write_killable(&mm->mmap_sem)) { 298 299 err = -EINTR;
+2
fs/hugetlbfs/inode.c
··· 411 411 bool truncate_op = (lend == LLONG_MAX); 412 412 413 413 memset(&pseudo_vma, 0, sizeof(struct vm_area_struct)); 414 + vma_init(&pseudo_vma, current->mm); 414 415 pseudo_vma.vm_flags = (VM_HUGETLB | VM_MAYSHARE | VM_SHARED); 415 416 pagevec_init(&pvec); 416 417 next = start; ··· 596 595 * as input to create an allocation policy. 597 596 */ 598 597 memset(&pseudo_vma, 0, sizeof(struct vm_area_struct)); 598 + vma_init(&pseudo_vma, mm); 599 599 pseudo_vma.vm_flags = (VM_HUGETLB | VM_MAYSHARE | VM_SHARED); 600 600 pseudo_vma.vm_file = file; 601 601
+1 -1
include/linux/delayacct.h
··· 124 124 125 125 static inline void delayacct_blkio_end(struct task_struct *p) 126 126 { 127 - if (current->delays) 127 + if (p->delays) 128 128 __delayacct_blkio_end(p); 129 129 delayacct_clear_flag(DELAYACCT_PF_BLKIO); 130 130 }
+1
include/linux/eventfd.h
··· 11 11 12 12 #include <linux/fcntl.h> 13 13 #include <linux/wait.h> 14 + #include <linux/err.h> 14 15 15 16 /* 16 17 * CAREFUL: Check include/uapi/asm-generic/fcntl.h when defining
+14
include/linux/mm.h
··· 452 452 unsigned long addr); 453 453 }; 454 454 455 + static inline void vma_init(struct vm_area_struct *vma, struct mm_struct *mm) 456 + { 457 + static const struct vm_operations_struct dummy_vm_ops = {}; 458 + 459 + vma->vm_mm = mm; 460 + vma->vm_ops = &dummy_vm_ops; 461 + INIT_LIST_HEAD(&vma->anon_vma_chain); 462 + } 463 + 464 + static inline void vma_set_anonymous(struct vm_area_struct *vma) 465 + { 466 + vma->vm_ops = NULL; 467 + } 468 + 455 469 struct mmu_gather; 456 470 struct inode; 457 471
+1 -1
ipc/sem.c
··· 2118 2118 } 2119 2119 2120 2120 do { 2121 - queue.status = -EINTR; 2121 + WRITE_ONCE(queue.status, -EINTR); 2122 2122 queue.sleeper = current; 2123 2123 2124 2124 __set_current_state(TASK_INTERRUPTIBLE);
+2 -4
kernel/fork.c
··· 312 312 { 313 313 struct vm_area_struct *vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL); 314 314 315 - if (vma) { 316 - vma->vm_mm = mm; 317 - INIT_LIST_HEAD(&vma->anon_vma_chain); 318 - } 315 + if (vma) 316 + vma_init(vma, mm); 319 317 return vma; 320 318 } 321 319
+19 -3
kernel/memremap.c
··· 176 176 unsigned long pfn, pgoff, order; 177 177 pgprot_t pgprot = PAGE_KERNEL; 178 178 int error, nid, is_ram; 179 + struct dev_pagemap *conflict_pgmap; 179 180 180 181 align_start = res->start & ~(SECTION_SIZE - 1); 181 182 align_size = ALIGN(res->start + resource_size(res), SECTION_SIZE) 182 183 - align_start; 184 + align_end = align_start + align_size - 1; 185 + 186 + conflict_pgmap = get_dev_pagemap(PHYS_PFN(align_start), NULL); 187 + if (conflict_pgmap) { 188 + dev_WARN(dev, "Conflicting mapping in same section\n"); 189 + put_dev_pagemap(conflict_pgmap); 190 + return ERR_PTR(-ENOMEM); 191 + } 192 + 193 + conflict_pgmap = get_dev_pagemap(PHYS_PFN(align_end), NULL); 194 + if (conflict_pgmap) { 195 + dev_WARN(dev, "Conflicting mapping in same section\n"); 196 + put_dev_pagemap(conflict_pgmap); 197 + return ERR_PTR(-ENOMEM); 198 + } 199 + 183 200 is_ram = region_intersects(align_start, align_size, 184 201 IORESOURCE_SYSTEM_RAM, IORES_DESC_NONE); 185 202 ··· 216 199 217 200 mutex_lock(&pgmap_lock); 218 201 error = 0; 219 - align_end = align_start + align_size - 1; 220 202 221 203 foreach_order_pgoff(res, order, pgoff) { 222 204 error = __radix_tree_insert(&pgmap_radix, ··· 321 305 322 306 #ifdef CONFIG_DEV_PAGEMAP_OPS 323 307 DEFINE_STATIC_KEY_FALSE(devmap_managed_key); 324 - EXPORT_SYMBOL_GPL(devmap_managed_key); 308 + EXPORT_SYMBOL(devmap_managed_key); 325 309 static atomic_t devmap_enable; 326 310 327 311 /* ··· 362 346 } else if (!count) 363 347 __put_page(page); 364 348 } 365 - EXPORT_SYMBOL_GPL(__put_devmap_managed_page); 349 + EXPORT_SYMBOL(__put_devmap_managed_page); 366 350 #endif /* CONFIG_DEV_PAGEMAP_OPS */
+1 -1
lib/Kconfig.kasan
··· 5 5 6 6 config KASAN 7 7 bool "KASan: runtime memory debugger" 8 - depends on SLUB || (SLAB && !DEBUG_SLAB) 8 + depends on (SLUB && SYSFS) || (SLAB && !DEBUG_SLAB) 9 9 select SLUB_DEBUG if SLUB 10 10 select CONSTRUCTORS 11 11 select STACKDEPOT
+1
mm/mempolicy.c
··· 2505 2505 2506 2506 /* Create pseudo-vma that contains just the policy */ 2507 2507 memset(&pvma, 0, sizeof(struct vm_area_struct)); 2508 + vma_init(&pvma, NULL); 2508 2509 pvma.vm_end = TASK_SIZE; /* policy covers entire file */ 2509 2510 mpol_set_shared_policy(sp, &pvma, new); /* adds ref */ 2510 2511
+3
mm/mmap.c
··· 1778 1778 error = shmem_zero_setup(vma); 1779 1779 if (error) 1780 1780 goto free_vma; 1781 + } else { 1782 + vma_set_anonymous(vma); 1781 1783 } 1782 1784 1783 1785 vma_link(mm, vma, prev, rb_link, rb_parent); ··· 2985 2983 return -ENOMEM; 2986 2984 } 2987 2985 2986 + vma_set_anonymous(vma); 2988 2987 vma->vm_start = addr; 2989 2988 vma->vm_end = addr + len; 2990 2989 vma->vm_pgoff = pgoff;
+2
mm/nommu.c
··· 1145 1145 if (ret < len) 1146 1146 memset(base + ret, 0, len - ret); 1147 1147 1148 + } else { 1149 + vma_set_anonymous(vma); 1148 1150 } 1149 1151 1150 1152 return 0;
+1
mm/shmem.c
··· 1421 1421 { 1422 1422 /* Create a pseudo vma that just contains the policy */ 1423 1423 memset(vma, 0, sizeof(*vma)); 1424 + vma_init(vma, NULL); 1424 1425 /* Bias interleave by inode number to distribute better across nodes */ 1425 1426 vma->vm_pgoff = index + info->vfs_inode.i_ino; 1426 1427 vma->vm_policy = mpol_shared_policy_lookup(&info->policy, index);
+9
mm/zswap.c
··· 1026 1026 ret = -ENOMEM; 1027 1027 goto reject; 1028 1028 } 1029 + 1030 + /* A second zswap_is_full() check after 1031 + * zswap_shrink() to make sure it's now 1032 + * under the max_pool_percent 1033 + */ 1034 + if (zswap_is_full()) { 1035 + ret = -ENOMEM; 1036 + goto reject; 1037 + } 1029 1038 } 1030 1039 1031 1040 /* allocate entry */