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:
"8 patches.

Subsystems affected by this patch series: proc, selftests, kbuild, and
mm (pagecache, kasan, hugetlb)"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
mm/hugetlb: clear compound_nr before freeing gigantic pages
kasan: fix object remaining in offline per-cpu quarantine
elfcore: fix building with clang
initramfs: fix clang build failure
kbuild: avoid static_assert for genksyms
selftest/fpu: avoid clang warning
proc: use untagged_addr() for pagemap_read addresses
revert "mm/filemap: add static for function __add_to_page_cache_locked"

+77 -32
+6 -2
fs/proc/task_mmu.c
··· 1599 1599 1600 1600 src = *ppos; 1601 1601 svpfn = src / PM_ENTRY_BYTES; 1602 - start_vaddr = svpfn << PAGE_SHIFT; 1603 1602 end_vaddr = mm->task_size; 1604 1603 1605 1604 /* watch out for wraparound */ 1606 - if (svpfn > mm->task_size >> PAGE_SHIFT) 1605 + start_vaddr = end_vaddr; 1606 + if (svpfn <= (ULONG_MAX >> PAGE_SHIFT)) 1607 + start_vaddr = untagged_addr(svpfn << PAGE_SHIFT); 1608 + 1609 + /* Ensure the address is inside the task */ 1610 + if (start_vaddr > mm->task_size) 1607 1611 start_vaddr = end_vaddr; 1608 1612 1609 1613 /*
+5
include/linux/build_bug.h
··· 77 77 #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr) 78 78 #define __static_assert(expr, msg, ...) _Static_assert(expr, msg) 79 79 80 + #ifdef __GENKSYMS__ 81 + /* genksyms gets confused by _Static_assert */ 82 + #define _Static_assert(expr, ...) 83 + #endif 84 + 80 85 #endif /* _LINUX_BUILD_BUG_H */
+22
include/linux/elfcore.h
··· 104 104 #endif 105 105 } 106 106 107 + #if defined(CONFIG_UM) || defined(CONFIG_IA64) 107 108 /* 108 109 * These functions parameterize elf_core_dump in fs/binfmt_elf.c to write out 109 110 * extra segments containing the gate DSO contents. Dumping its ··· 119 118 extern int 120 119 elf_core_write_extra_data(struct coredump_params *cprm); 121 120 extern size_t elf_core_extra_data_size(void); 121 + #else 122 + static inline Elf_Half elf_core_extra_phdrs(void) 123 + { 124 + return 0; 125 + } 126 + 127 + static inline int elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset) 128 + { 129 + return 1; 130 + } 131 + 132 + static inline int elf_core_write_extra_data(struct coredump_params *cprm) 133 + { 134 + return 1; 135 + } 136 + 137 + static inline size_t elf_core_extra_data_size(void) 138 + { 139 + return 0; 140 + } 141 + #endif 122 142 123 143 #endif /* _LINUX_ELFCORE_H */
+1 -1
init/initramfs.c
··· 535 535 #include <linux/initrd.h> 536 536 #include <linux/kexec.h> 537 537 538 - void __weak free_initrd_mem(unsigned long start, unsigned long end) 538 + void __weak __init free_initrd_mem(unsigned long start, unsigned long end) 539 539 { 540 540 #ifdef CONFIG_ARCH_KEEP_MEMBLOCK 541 541 unsigned long aligned_start = ALIGN_DOWN(start, PAGE_SIZE);
-1
kernel/Makefile
··· 97 97 obj-$(CONFIG_TASKSTATS) += taskstats.o tsacct.o 98 98 obj-$(CONFIG_TRACEPOINTS) += tracepoint.o 99 99 obj-$(CONFIG_LATENCYTOP) += latencytop.o 100 - obj-$(CONFIG_ELFCORE) += elfcore.o 101 100 obj-$(CONFIG_FUNCTION_TRACER) += trace/ 102 101 obj-$(CONFIG_TRACING) += trace/ 103 102 obj-$(CONFIG_TRACE_CLOCK) += trace/
-26
kernel/elfcore.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - #include <linux/elf.h> 3 - #include <linux/fs.h> 4 - #include <linux/mm.h> 5 - #include <linux/binfmts.h> 6 - #include <linux/elfcore.h> 7 - 8 - Elf_Half __weak elf_core_extra_phdrs(void) 9 - { 10 - return 0; 11 - } 12 - 13 - int __weak elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset) 14 - { 15 - return 1; 16 - } 17 - 18 - int __weak elf_core_write_extra_data(struct coredump_params *cprm) 19 - { 20 - return 1; 21 - } 22 - 23 - size_t __weak elf_core_extra_data_size(void) 24 - { 25 - return 0; 26 - }
+2 -1
lib/Makefile
··· 107 107 # off the generation of FPU/SSE* instructions for kernel proper but FPU_FLAGS 108 108 # get appended last to CFLAGS and thus override those previous compiler options. 109 109 # 110 - FPU_CFLAGS := -mhard-float -msse -msse2 110 + FPU_CFLAGS := -msse -msse2 111 111 ifdef CONFIG_CC_IS_GCC 112 112 # Stack alignment mismatch, proceed with caution. 113 113 # GCC < 7.1 cannot compile code using `double` and -mpreferred-stack-boundary=3 ··· 120 120 # -mpreferred-stack-boundary=3 is not between 4 and 12 121 121 # 122 122 # can be triggered. Otherwise gcc doesn't complain. 123 + FPU_CFLAGS += -mhard-float 123 124 FPU_CFLAGS += $(call cc-option,-msse -mpreferred-stack-boundary=3,-mpreferred-stack-boundary=4) 124 125 endif 125 126
+1 -1
mm/filemap.c
··· 827 827 } 828 828 EXPORT_SYMBOL_GPL(replace_page_cache_page); 829 829 830 - static noinline int __add_to_page_cache_locked(struct page *page, 830 + noinline int __add_to_page_cache_locked(struct page *page, 831 831 struct address_space *mapping, 832 832 pgoff_t offset, gfp_t gfp, 833 833 void **shadowp)
+1
mm/hugetlb.c
··· 1216 1216 } 1217 1217 1218 1218 set_compound_order(page, 0); 1219 + page[1].compound_nr = 0; 1219 1220 __ClearPageHead(page); 1220 1221 } 1221 1222
+39
mm/kasan/quarantine.c
··· 29 29 #include <linux/srcu.h> 30 30 #include <linux/string.h> 31 31 #include <linux/types.h> 32 + #include <linux/cpuhotplug.h> 32 33 33 34 #include "../slab.h" 34 35 #include "kasan.h" ··· 44 43 struct qlist_node *head; 45 44 struct qlist_node *tail; 46 45 size_t bytes; 46 + bool offline; 47 47 }; 48 48 49 49 #define QLIST_INIT { NULL, NULL, 0 } ··· 190 188 local_irq_save(flags); 191 189 192 190 q = this_cpu_ptr(&cpu_quarantine); 191 + if (q->offline) { 192 + local_irq_restore(flags); 193 + return; 194 + } 193 195 qlist_put(q, &info->quarantine_link, cache->size); 194 196 if (unlikely(q->bytes > QUARANTINE_PERCPU_SIZE)) { 195 197 qlist_move_all(q, &temp); ··· 334 328 335 329 synchronize_srcu(&remove_cache_srcu); 336 330 } 331 + 332 + static int kasan_cpu_online(unsigned int cpu) 333 + { 334 + this_cpu_ptr(&cpu_quarantine)->offline = false; 335 + return 0; 336 + } 337 + 338 + static int kasan_cpu_offline(unsigned int cpu) 339 + { 340 + struct qlist_head *q; 341 + 342 + q = this_cpu_ptr(&cpu_quarantine); 343 + /* Ensure the ordering between the writing to q->offline and 344 + * qlist_free_all. Otherwise, cpu_quarantine may be corrupted 345 + * by interrupt. 346 + */ 347 + WRITE_ONCE(q->offline, true); 348 + barrier(); 349 + qlist_free_all(q, NULL); 350 + return 0; 351 + } 352 + 353 + static int __init kasan_cpu_quarantine_init(void) 354 + { 355 + int ret = 0; 356 + 357 + ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "mm/kasan:online", 358 + kasan_cpu_online, kasan_cpu_offline); 359 + if (ret < 0) 360 + pr_err("kasan cpu quarantine register failed [%d]\n", ret); 361 + return ret; 362 + } 363 + late_initcall(kasan_cpu_quarantine_init);