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 tag 'mm-hotfixes-stable-2022-05-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull misc fixes from Andrew Morton:
"Seven MM fixes, three of which address issues added in the most recent
merge window, four of which are cc:stable.

Three non-MM fixes, none very serious"

[ And yes, that's a real pull request from Andrew, not me creating a
branch from emailed patches. Woo-hoo! ]

* tag 'mm-hotfixes-stable-2022-05-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
MAINTAINERS: add a mailing list for DAMON development
selftests: vm: Makefile: rename TARGETS to VMTARGETS
mm/kfence: reset PG_slab and memcg_data before freeing __kfence_pool
mailmap: add entry for martyna.szapar-mudlaw@intel.com
arm[64]/memremap: don't abuse pfn_valid() to ensure presence of linear map
procfs: prevent unprivileged processes accessing fdinfo dir
mm: mremap: fix sign for EFAULT error return value
mm/hwpoison: use pr_err() instead of dump_page() in get_any_page()
mm/huge_memory: do not overkill when splitting huge_zero_page
Revert "mm/memory-failure.c: skip huge_zero_page in memory_failure()"

+70 -22
+1
.mailmap
··· 251 251 Martin Kepplinger <martink@posteo.de> <martin.kepplinger@ginzinger.com> 252 252 Martin Kepplinger <martink@posteo.de> <martin.kepplinger@puri.sm> 253 253 Martin Kepplinger <martink@posteo.de> <martin.kepplinger@theobroma-systems.com> 254 + Martyna Szapar-Mudlaw <martyna.szapar-mudlaw@linux.intel.com> <martyna.szapar-mudlaw@intel.com> 254 255 Mathieu Othacehe <m.othacehe@gmail.com> 255 256 Matthew Wilcox <willy@infradead.org> <matthew.r.wilcox@intel.com> 256 257 Matthew Wilcox <willy@infradead.org> <matthew@wil.cx>
+1
MAINTAINERS
··· 5440 5440 5441 5441 DATA ACCESS MONITOR 5442 5442 M: SeongJae Park <sj@kernel.org> 5443 + L: damon@lists.linux.dev 5443 5444 L: linux-mm@kvack.org 5444 5445 S: Maintained 5445 5446 F: Documentation/ABI/testing/sysfs-kernel-mm-damon
+3
arch/arm/include/asm/io.h
··· 440 440 #define ARCH_HAS_VALID_PHYS_ADDR_RANGE 441 441 extern int valid_phys_addr_range(phys_addr_t addr, size_t size); 442 442 extern int valid_mmap_phys_addr_range(unsigned long pfn, size_t size); 443 + extern bool arch_memremap_can_ram_remap(resource_size_t offset, size_t size, 444 + unsigned long flags); 445 + #define arch_memremap_can_ram_remap arch_memremap_can_ram_remap 443 446 #endif 444 447 445 448 /*
+8
arch/arm/mm/ioremap.c
··· 493 493 { 494 494 early_ioremap_setup(); 495 495 } 496 + 497 + bool arch_memremap_can_ram_remap(resource_size_t offset, size_t size, 498 + unsigned long flags) 499 + { 500 + unsigned long pfn = PHYS_PFN(offset); 501 + 502 + return memblock_is_map_memory(pfn); 503 + }
+4
arch/arm64/include/asm/io.h
··· 192 192 extern int valid_phys_addr_range(phys_addr_t addr, size_t size); 193 193 extern int valid_mmap_phys_addr_range(unsigned long pfn, size_t size); 194 194 195 + extern bool arch_memremap_can_ram_remap(resource_size_t offset, size_t size, 196 + unsigned long flags); 197 + #define arch_memremap_can_ram_remap arch_memremap_can_ram_remap 198 + 195 199 #endif /* __ASM_IO_H */
+8
arch/arm64/mm/ioremap.c
··· 99 99 { 100 100 early_ioremap_setup(); 101 101 } 102 + 103 + bool arch_memremap_can_ram_remap(resource_size_t offset, size_t size, 104 + unsigned long flags) 105 + { 106 + unsigned long pfn = PHYS_PFN(offset); 107 + 108 + return pfn_is_map_memory(pfn); 109 + }
+22 -1
fs/proc/fd.c
··· 72 72 return 0; 73 73 } 74 74 75 - static int seq_fdinfo_open(struct inode *inode, struct file *file) 75 + static int proc_fdinfo_access_allowed(struct inode *inode) 76 76 { 77 77 bool allowed = false; 78 78 struct task_struct *task = get_proc_task(inode); ··· 85 85 86 86 if (!allowed) 87 87 return -EACCES; 88 + 89 + return 0; 90 + } 91 + 92 + static int seq_fdinfo_open(struct inode *inode, struct file *file) 93 + { 94 + int ret = proc_fdinfo_access_allowed(inode); 95 + 96 + if (ret) 97 + return ret; 88 98 89 99 return single_open(file, seq_show, inode); 90 100 } ··· 358 348 proc_fdinfo_instantiate); 359 349 } 360 350 351 + static int proc_open_fdinfo(struct inode *inode, struct file *file) 352 + { 353 + int ret = proc_fdinfo_access_allowed(inode); 354 + 355 + if (ret) 356 + return ret; 357 + 358 + return 0; 359 + } 360 + 361 361 const struct inode_operations proc_fdinfo_inode_operations = { 362 362 .lookup = proc_lookupfdinfo, 363 363 .setattr = proc_setattr, 364 364 }; 365 365 366 366 const struct file_operations proc_fdinfo_operations = { 367 + .open = proc_open_fdinfo, 367 368 .read = generic_read_dir, 368 369 .iterate_shared = proc_readfdinfo, 369 370 .llseek = generic_file_llseek,
+6 -1
mm/huge_memory.c
··· 2495 2495 struct address_space *mapping = NULL; 2496 2496 int extra_pins, ret; 2497 2497 pgoff_t end; 2498 + bool is_hzp; 2498 2499 2499 - VM_BUG_ON_PAGE(is_huge_zero_page(head), head); 2500 2500 VM_BUG_ON_PAGE(!PageLocked(head), head); 2501 2501 VM_BUG_ON_PAGE(!PageCompound(head), head); 2502 + 2503 + is_hzp = is_huge_zero_page(head); 2504 + VM_WARN_ON_ONCE_PAGE(is_hzp, head); 2505 + if (is_hzp) 2506 + return -EBUSY; 2502 2507 2503 2508 if (PageWriteback(head)) 2504 2509 return -EBUSY;
+10
mm/kfence/core.c
··· 621 621 * fails for the first page, and therefore expect addr==__kfence_pool in 622 622 * most failure cases. 623 623 */ 624 + for (char *p = (char *)addr; p < __kfence_pool + KFENCE_POOL_SIZE; p += PAGE_SIZE) { 625 + struct slab *slab = virt_to_slab(p); 626 + 627 + if (!slab) 628 + continue; 629 + #ifdef CONFIG_MEMCG 630 + slab->memcg_data = 0; 631 + #endif 632 + __folio_clear_slab(slab_folio(slab)); 633 + } 624 634 memblock_free_late(__pa(addr), KFENCE_POOL_SIZE - (addr - (unsigned long)__kfence_pool)); 625 635 __kfence_pool = NULL; 626 636 return false;
+1 -14
mm/memory-failure.c
··· 1274 1274 } 1275 1275 out: 1276 1276 if (ret == -EIO) 1277 - dump_page(p, "hwpoison: unhandlable page"); 1277 + pr_err("Memory failure: %#lx: unhandlable page.\n", page_to_pfn(p)); 1278 1278 1279 1279 return ret; 1280 1280 } ··· 1860 1860 } 1861 1861 1862 1862 if (PageTransHuge(hpage)) { 1863 - /* 1864 - * Bail out before SetPageHasHWPoisoned() if hpage is 1865 - * huge_zero_page, although PG_has_hwpoisoned is not 1866 - * checked in set_huge_zero_page(). 1867 - * 1868 - * TODO: Handle memory failure of huge_zero_page thoroughly. 1869 - */ 1870 - if (is_huge_zero_page(hpage)) { 1871 - action_result(pfn, MF_MSG_UNSPLIT_THP, MF_IGNORED); 1872 - res = -EBUSY; 1873 - goto unlock_mutex; 1874 - } 1875 - 1876 1863 /* 1877 1864 * The flag must be set after the refcount is bumped 1878 1865 * otherwise it may race with THP split.
+1 -1
mm/mremap.c
··· 947 947 return -EINTR; 948 948 vma = vma_lookup(mm, addr); 949 949 if (!vma) { 950 - ret = EFAULT; 950 + ret = -EFAULT; 951 951 goto out; 952 952 } 953 953
+5 -5
tools/testing/selftests/vm/Makefile
··· 57 57 CAN_BUILD_X86_64 := $(shell ./../x86/check_cc.sh "$(CC)" ../x86/trivial_64bit_program.c) 58 58 CAN_BUILD_WITH_NOPIE := $(shell ./../x86/check_cc.sh "$(CC)" ../x86/trivial_program.c -no-pie) 59 59 60 - TARGETS := protection_keys 61 - BINARIES_32 := $(TARGETS:%=%_32) 62 - BINARIES_64 := $(TARGETS:%=%_64) 60 + VMTARGETS := protection_keys 61 + BINARIES_32 := $(VMTARGETS:%=%_32) 62 + BINARIES_64 := $(VMTARGETS:%=%_64) 63 63 64 64 ifeq ($(CAN_BUILD_WITH_NOPIE),1) 65 65 CFLAGS += -no-pie ··· 112 112 $(BINARIES_32): LDLIBS += -lrt -ldl -lm 113 113 $(BINARIES_32): $(OUTPUT)/%_32: %.c 114 114 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(notdir $^) $(LDLIBS) -o $@ 115 - $(foreach t,$(TARGETS),$(eval $(call gen-target-rule-32,$(t)))) 115 + $(foreach t,$(VMTARGETS),$(eval $(call gen-target-rule-32,$(t)))) 116 116 endif 117 117 118 118 ifeq ($(CAN_BUILD_X86_64),1) ··· 120 120 $(BINARIES_64): LDLIBS += -lrt -ldl 121 121 $(BINARIES_64): $(OUTPUT)/%_64: %.c 122 122 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(notdir $^) $(LDLIBS) -o $@ 123 - $(foreach t,$(TARGETS),$(eval $(call gen-target-rule-64,$(t)))) 123 + $(foreach t,$(VMTARGETS),$(eval $(call gen-target-rule-64,$(t)))) 124 124 endif 125 125 126 126 # x86_64 users should be encouraged to install 32-bit libraries