Merge branch 'akpm' (patches from Andrew)

Merge misc fixes from Andrew Morton:
"Five fixes.

Subsystems affected by this patch series: MAINTAINERS, mm/pagemap,
mm/swap, and mm/hugetlb"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
mm: khugepaged: recalculate min_free_kbytes after memory hotplug as expected by khugepaged
mm: validate inode in mapping_set_error()
mm: mmap: Fix general protection fault in unlink_file_vma()
MAINTAINERS: Antoine Tenart's email address
MAINTAINERS: change hardening mailing list

+3 -1
.mailmap
··· 41 41 Andrew Vasquez <andrew.vasquez@qlogic.com> 42 42 Andrey Ryabinin <ryabinin.a.a@gmail.com> <a.ryabinin@samsung.com> 43 43 Andy Adamson <andros@citi.umich.edu> 44 - Antoine Tenart <antoine.tenart@free-electrons.com> 44 + Antoine Tenart <atenart@kernel.org> <antoine.tenart@bootlin.com> 45 + Antoine Tenart <atenart@kernel.org> <antoine.tenart@free-electrons.com> 45 46 Antonio Ospite <ao2@ao2.it> <ao2@amarulasolutions.com> 46 47 Archit Taneja <archit@ti.com> 47 48 Ard Biesheuvel <ardb@kernel.org> <ard.biesheuvel@linaro.org> ··· 189 188 Linas Vepstas <linas@austin.ibm.com> 190 189 Linus Lüssing <linus.luessing@c0d3.blue> <linus.luessing@ascom.ch> 191 190 Linus Lüssing <linus.luessing@c0d3.blue> <linus.luessing@web.de> 191 + <linux-hardening@vger.kernel.org> <kernel-hardening@lists.openwall.com> 192 192 Li Yang <leoyang.li@nxp.com> <leoli@freescale.com> 193 193 Li Yang <leoyang.li@nxp.com> <leo@zh-kernel.org> 194 194 Lukasz Luba <lukasz.luba@arm.com> <l.luba@partner.samsung.com>
+4 -4
MAINTAINERS
··· 1628 1628 1629 1629 ARM/Annapurna Labs ALPINE ARCHITECTURE 1630 1630 M: Tsahee Zidenberg <tsahee@annapurnalabs.com> 1631 - M: Antoine Tenart <antoine.tenart@bootlin.com> 1631 + M: Antoine Tenart <atenart@kernel.org> 1632 1632 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 1633 1633 S: Maintained 1634 1634 F: arch/arm/boot/dts/alpine* ··· 7240 7240 GCC PLUGINS 7241 7241 M: Kees Cook <keescook@chromium.org> 7242 7242 R: Emese Revfy <re.emese@gmail.com> 7243 - L: kernel-hardening@lists.openwall.com 7243 + L: linux-hardening@vger.kernel.org 7244 7244 S: Maintained 7245 7245 F: Documentation/kbuild/gcc-plugins.rst 7246 7246 F: scripts/Makefile.gcc-plugins ··· 8678 8678 K: \b(ABS|SYN)_MT_ 8679 8679 8680 8680 INSIDE SECURE CRYPTO DRIVER 8681 - M: Antoine Tenart <antoine.tenart@bootlin.com> 8681 + M: Antoine Tenart <atenart@kernel.org> 8682 8682 L: linux-crypto@vger.kernel.org 8683 8683 S: Maintained 8684 8684 F: drivers/crypto/inside-secure/ ··· 9802 9802 LEAKING_ADDRESSES 9803 9803 M: Tobin C. Harding <me@tobin.cc> 9804 9804 M: Tycho Andersen <tycho@tycho.pizza> 9805 - L: kernel-hardening@lists.openwall.com 9805 + L: linux-hardening@vger.kernel.org 9806 9806 S: Maintained 9807 9807 T: git git://git.kernel.org/pub/scm/linux/kernel/git/tobin/leaks.git 9808 9808 F: scripts/leaking_addresses.pl
+5
include/linux/khugepaged.h
··· 15 15 extern void __khugepaged_exit(struct mm_struct *mm); 16 16 extern int khugepaged_enter_vma_merge(struct vm_area_struct *vma, 17 17 unsigned long vm_flags); 18 + extern void khugepaged_min_free_kbytes_update(void); 18 19 #ifdef CONFIG_SHMEM 19 20 extern void collapse_pte_mapped_thp(struct mm_struct *mm, unsigned long addr); 20 21 #else ··· 84 83 } 85 84 static inline void collapse_pte_mapped_thp(struct mm_struct *mm, 86 85 unsigned long addr) 86 + { 87 + } 88 + 89 + static inline void khugepaged_min_free_kbytes_update(void) 87 90 { 88 91 } 89 92 #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
+2 -1
include/linux/pagemap.h
··· 54 54 __filemap_set_wb_err(mapping, error); 55 55 56 56 /* Record it in superblock */ 57 - errseq_set(&mapping->host->i_sb->s_wb_err, error); 57 + if (mapping->host) 58 + errseq_set(&mapping->host->i_sb->s_wb_err, error); 58 59 59 60 /* Record it in flags for now, for legacy callers */ 60 61 if (error == -ENOSPC)
+11 -2
mm/khugepaged.c
··· 56 56 #define CREATE_TRACE_POINTS 57 57 #include <trace/events/huge_memory.h> 58 58 59 + static struct task_struct *khugepaged_thread __read_mostly; 60 + static DEFINE_MUTEX(khugepaged_mutex); 61 + 59 62 /* default scan 8*512 pte (or vmas) every 30 second */ 60 63 static unsigned int khugepaged_pages_to_scan __read_mostly; 61 64 static unsigned int khugepaged_pages_collapsed; ··· 2307 2304 2308 2305 int start_stop_khugepaged(void) 2309 2306 { 2310 - static struct task_struct *khugepaged_thread __read_mostly; 2311 - static DEFINE_MUTEX(khugepaged_mutex); 2312 2307 int err = 0; 2313 2308 2314 2309 mutex_lock(&khugepaged_mutex); ··· 2332 2331 fail: 2333 2332 mutex_unlock(&khugepaged_mutex); 2334 2333 return err; 2334 + } 2335 + 2336 + void khugepaged_min_free_kbytes_update(void) 2337 + { 2338 + mutex_lock(&khugepaged_mutex); 2339 + if (khugepaged_enabled() && khugepaged_thread) 2340 + set_recommended_min_free_kbytes(); 2341 + mutex_unlock(&khugepaged_mutex); 2335 2342 }
+5 -1
mm/mmap.c
··· 1781 1781 merge = vma_merge(mm, prev, vma->vm_start, vma->vm_end, vma->vm_flags, 1782 1782 NULL, vma->vm_file, vma->vm_pgoff, NULL, NULL_VM_UFFD_CTX); 1783 1783 if (merge) { 1784 - fput(file); 1784 + /* ->mmap() can change vma->vm_file and fput the original file. So 1785 + * fput the vma->vm_file here or we would add an extra fput for file 1786 + * and cause general protection fault ultimately. 1787 + */ 1788 + fput(vma->vm_file); 1785 1789 vm_area_free(vma); 1786 1790 vma = merge; 1787 1791 /* Update vm_flags and possible addr to pick up the change. We don't
+3
mm/page_alloc.c
··· 69 69 #include <linux/nmi.h> 70 70 #include <linux/psi.h> 71 71 #include <linux/padata.h> 72 + #include <linux/khugepaged.h> 72 73 73 74 #include <asm/sections.h> 74 75 #include <asm/tlbflush.h> ··· 7904 7903 setup_min_unmapped_ratio(); 7905 7904 setup_min_slab_ratio(); 7906 7905 #endif 7906 + 7907 + khugepaged_min_free_kbytes_update(); 7907 7908 7908 7909 return 0; 7909 7910 }