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>:
kasan: do not sanitize kexec purgatory
drivers/rapidio/devices/tsi721.c: make module parameter variable name unique
mm/hugetlb.c: don't call region_abort if region_chg fails
kasan: report only the first error by default
hugetlbfs: initialize shared policy as part of inode allocation
mm: fix section name for .data..ro_after_init
mm, hugetlb: use pte_present() instead of pmd_present() in follow_huge_pmd()
mm: workingset: fix premature shadow node shrinking with cgroups
mm: rmap: fix huge file mmap accounting in the memcg stats
mm: move mm_percpu_wq initialization earlier
mm: migrate: fix remove_migration_pte() for ksm pages

+104 -42
+6
Documentation/admin-guide/kernel-parameters.txt
··· 1725 1725 kernel and module base offset ASLR (Address Space 1726 1726 Layout Randomization). 1727 1727 1728 + kasan_multi_shot 1729 + [KNL] Enforce KASAN (Kernel Address Sanitizer) to print 1730 + report on every invalid memory access. Without this 1731 + parameter KASAN will print report only for the first 1732 + invalid access. 1733 + 1728 1734 keepinitrd [HW,ARM] 1729 1735 1730 1736 kernelcore= [KNL,X86,IA-64,PPC]
-1
arch/s390/include/asm/sections.h
··· 4 4 #include <asm-generic/sections.h> 5 5 6 6 extern char _eshared[], _ehead[]; 7 - extern char __start_ro_after_init[], __end_ro_after_init[]; 8 7 9 8 #endif
-2
arch/s390/kernel/vmlinux.lds.S
··· 63 63 64 64 . = ALIGN(PAGE_SIZE); 65 65 __start_ro_after_init = .; 66 - __start_data_ro_after_init = .; 67 66 .data..ro_after_init : { 68 67 *(.data..ro_after_init) 69 68 } 70 - __end_data_ro_after_init = .; 71 69 EXCEPTION_TABLE(16) 72 70 . = ALIGN(PAGE_SIZE); 73 71 __end_ro_after_init = .;
+1
arch/x86/purgatory/Makefile
··· 8 8 LDFLAGS_purgatory.ro := -e purgatory_start -r --no-undefined -nostdlib -z nodefaultlib 9 9 targets += purgatory.ro 10 10 11 + KASAN_SANITIZE := n 11 12 KCOV_INSTRUMENT := n 12 13 13 14 # Default KBUILD_CFLAGS can have -pg option set when FTRACE is enabled. That
+2 -2
drivers/rapidio/devices/tsi721.c
··· 37 37 #include "tsi721.h" 38 38 39 39 #ifdef DEBUG 40 - u32 dbg_level; 41 - module_param(dbg_level, uint, S_IWUSR | S_IRUGO); 40 + u32 tsi_dbg_level; 41 + module_param_named(dbg_level, tsi_dbg_level, uint, S_IWUSR | S_IRUGO); 42 42 MODULE_PARM_DESC(dbg_level, "Debugging output level (default 0 = none)"); 43 43 #endif 44 44
+2 -2
drivers/rapidio/devices/tsi721.h
··· 40 40 }; 41 41 42 42 #ifdef DEBUG 43 - extern u32 dbg_level; 43 + extern u32 tsi_dbg_level; 44 44 45 45 #define tsi_debug(level, dev, fmt, arg...) \ 46 46 do { \ 47 - if (DBG_##level & dbg_level) \ 47 + if (DBG_##level & tsi_dbg_level) \ 48 48 dev_dbg(dev, "%s: " fmt "\n", __func__, ##arg); \ 49 49 } while (0) 50 50 #else
+12 -13
fs/hugetlbfs/inode.c
··· 695 695 696 696 inode = new_inode(sb); 697 697 if (inode) { 698 - struct hugetlbfs_inode_info *info; 699 698 inode->i_ino = get_next_ino(); 700 699 inode->i_mode = S_IFDIR | config->mode; 701 700 inode->i_uid = config->uid; 702 701 inode->i_gid = config->gid; 703 702 inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); 704 - info = HUGETLBFS_I(inode); 705 - mpol_shared_policy_init(&info->policy, NULL); 706 703 inode->i_op = &hugetlbfs_dir_inode_operations; 707 704 inode->i_fop = &simple_dir_operations; 708 705 /* directory inodes start off with i_nlink == 2 (for "." entry) */ ··· 730 733 731 734 inode = new_inode(sb); 732 735 if (inode) { 733 - struct hugetlbfs_inode_info *info; 734 736 inode->i_ino = get_next_ino(); 735 737 inode_init_owner(inode, dir, mode); 736 738 lockdep_set_class(&inode->i_mapping->i_mmap_rwsem, ··· 737 741 inode->i_mapping->a_ops = &hugetlbfs_aops; 738 742 inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); 739 743 inode->i_mapping->private_data = resv_map; 740 - info = HUGETLBFS_I(inode); 741 - /* 742 - * The policy is initialized here even if we are creating a 743 - * private inode because initialization simply creates an 744 - * an empty rb tree and calls rwlock_init(), later when we 745 - * call mpol_free_shared_policy() it will just return because 746 - * the rb tree will still be empty. 747 - */ 748 - mpol_shared_policy_init(&info->policy, NULL); 749 744 switch (mode & S_IFMT) { 750 745 default: 751 746 init_special_inode(inode, mode, dev); ··· 924 937 hugetlbfs_inc_free_inodes(sbinfo); 925 938 return NULL; 926 939 } 940 + 941 + /* 942 + * Any time after allocation, hugetlbfs_destroy_inode can be called 943 + * for the inode. mpol_free_shared_policy is unconditionally called 944 + * as part of hugetlbfs_destroy_inode. So, initialize policy here 945 + * in case of a quick call to destroy. 946 + * 947 + * Note that the policy is initialized even if we are creating a 948 + * private inode. This simplifies hugetlbfs_destroy_inode. 949 + */ 950 + mpol_shared_policy_init(&p->policy, NULL); 951 + 927 952 return &p->vfs_inode; 928 953 } 929 954
+3 -3
include/asm-generic/sections.h
··· 14 14 * [_sdata, _edata]: contains .data.* sections, may also contain .rodata.* 15 15 * and/or .init.* sections. 16 16 * [__start_rodata, __end_rodata]: contains .rodata.* sections 17 - * [__start_data_ro_after_init, __end_data_ro_after_init]: 18 - * contains data.ro_after_init section 17 + * [__start_ro_after_init, __end_ro_after_init]: 18 + * contains .data..ro_after_init section 19 19 * [__init_begin, __init_end]: contains .init.* sections, but .init.text.* 20 20 * may be out of this range on some architectures. 21 21 * [_sinittext, _einittext]: contains .init.text.* sections ··· 33 33 extern char __bss_start[], __bss_stop[]; 34 34 extern char __init_begin[], __init_end[]; 35 35 extern char _sinittext[], _einittext[]; 36 - extern char __start_data_ro_after_init[], __end_data_ro_after_init[]; 36 + extern char __start_ro_after_init[], __end_ro_after_init[]; 37 37 extern char _end[]; 38 38 extern char __per_cpu_load[], __per_cpu_start[], __per_cpu_end[]; 39 39 extern char __kprobes_text_start[], __kprobes_text_end[];
+2 -2
include/asm-generic/vmlinux.lds.h
··· 260 260 */ 261 261 #ifndef RO_AFTER_INIT_DATA 262 262 #define RO_AFTER_INIT_DATA \ 263 - __start_data_ro_after_init = .; \ 263 + __start_ro_after_init = .; \ 264 264 *(.data..ro_after_init) \ 265 - __end_data_ro_after_init = .; 265 + __end_ro_after_init = .; 266 266 #endif 267 267 268 268 /*
+3
include/linux/kasan.h
··· 76 76 static inline void kasan_unpoison_slab(const void *ptr) { ksize(ptr); } 77 77 size_t kasan_metadata_size(struct kmem_cache *cache); 78 78 79 + bool kasan_save_enable_multi_shot(void); 80 + void kasan_restore_multi_shot(bool enabled); 81 + 79 82 #else /* CONFIG_KASAN */ 80 83 81 84 static inline void kasan_unpoison_shadow(const void *address, size_t size) {}
+6
include/linux/memcontrol.h
··· 740 740 return false; 741 741 } 742 742 743 + static inline void mem_cgroup_update_page_stat(struct page *page, 744 + enum mem_cgroup_stat_index idx, 745 + int nr) 746 + { 747 + } 748 + 743 749 static inline void mem_cgroup_inc_page_stat(struct page *page, 744 750 enum mem_cgroup_stat_index idx) 745 751 {
+2
include/linux/mm.h
··· 32 32 struct writeback_control; 33 33 struct bdi_writeback; 34 34 35 + void init_mm_internals(void); 36 + 35 37 #ifndef CONFIG_NEED_MULTIPLE_NODES /* Don't use mapnrs, do it properly */ 36 38 extern unsigned long max_mapnr; 37 39
+2
init/main.c
··· 1022 1022 1023 1023 workqueue_init(); 1024 1024 1025 + init_mm_internals(); 1026 + 1025 1027 do_pre_smp_initcalls(); 1026 1028 lockup_detector_init(); 1027 1029
+10
lib/test_kasan.c
··· 20 20 #include <linux/string.h> 21 21 #include <linux/uaccess.h> 22 22 #include <linux/module.h> 23 + #include <linux/kasan.h> 23 24 24 25 /* 25 26 * Note: test functions are marked noinline so that their names appear in ··· 475 474 476 475 static int __init kmalloc_tests_init(void) 477 476 { 477 + /* 478 + * Temporarily enable multi-shot mode. Otherwise, we'd only get a 479 + * report for the first case. 480 + */ 481 + bool multishot = kasan_save_enable_multi_shot(); 482 + 478 483 kmalloc_oob_right(); 479 484 kmalloc_oob_left(); 480 485 kmalloc_node_oob_right(); ··· 506 499 ksize_unpoisons_memory(); 507 500 copy_user_test(); 508 501 use_after_scope_test(); 502 + 503 + kasan_restore_multi_shot(multishot); 504 + 509 505 return -EAGAIN; 510 506 } 511 507
+7 -3
mm/hugetlb.c
··· 4403 4403 return 0; 4404 4404 out_err: 4405 4405 if (!vma || vma->vm_flags & VM_MAYSHARE) 4406 - region_abort(resv_map, from, to); 4406 + /* Don't call region_abort if region_chg failed */ 4407 + if (chg >= 0) 4408 + region_abort(resv_map, from, to); 4407 4409 if (vma && is_vma_resv_set(vma, HPAGE_RESV_OWNER)) 4408 4410 kref_put(&resv_map->refs, resv_map_release); 4409 4411 return ret; ··· 4653 4651 { 4654 4652 struct page *page = NULL; 4655 4653 spinlock_t *ptl; 4654 + pte_t pte; 4656 4655 retry: 4657 4656 ptl = pmd_lockptr(mm, pmd); 4658 4657 spin_lock(ptl); ··· 4663 4660 */ 4664 4661 if (!pmd_huge(*pmd)) 4665 4662 goto out; 4666 - if (pmd_present(*pmd)) { 4663 + pte = huge_ptep_get((pte_t *)pmd); 4664 + if (pte_present(pte)) { 4667 4665 page = pmd_page(*pmd) + ((address & ~PMD_MASK) >> PAGE_SHIFT); 4668 4666 if (flags & FOLL_GET) 4669 4667 get_page(page); 4670 4668 } else { 4671 - if (is_hugetlb_entry_migration(huge_ptep_get((pte_t *)pmd))) { 4669 + if (is_hugetlb_entry_migration(pte)) { 4672 4670 spin_unlock(ptl); 4673 4671 __migration_entry_wait(mm, (pte_t *)pmd, ptl); 4674 4672 goto retry;
-5
mm/kasan/kasan.h
··· 96 96 << KASAN_SHADOW_SCALE_SHIFT); 97 97 } 98 98 99 - static inline bool kasan_report_enabled(void) 100 - { 101 - return !current->kasan_depth; 102 - } 103 - 104 99 void kasan_report(unsigned long addr, size_t size, 105 100 bool is_write, unsigned long ip); 106 101 void kasan_report_double_free(struct kmem_cache *cache, void *object,
+36
mm/kasan/report.c
··· 13 13 * 14 14 */ 15 15 16 + #include <linux/bitops.h> 16 17 #include <linux/ftrace.h> 18 + #include <linux/init.h> 17 19 #include <linux/kernel.h> 18 20 #include <linux/mm.h> 19 21 #include <linux/printk.h> ··· 293 291 } 294 292 295 293 kasan_end_report(&flags); 294 + } 295 + 296 + static unsigned long kasan_flags; 297 + 298 + #define KASAN_BIT_REPORTED 0 299 + #define KASAN_BIT_MULTI_SHOT 1 300 + 301 + bool kasan_save_enable_multi_shot(void) 302 + { 303 + return test_and_set_bit(KASAN_BIT_MULTI_SHOT, &kasan_flags); 304 + } 305 + EXPORT_SYMBOL_GPL(kasan_save_enable_multi_shot); 306 + 307 + void kasan_restore_multi_shot(bool enabled) 308 + { 309 + if (!enabled) 310 + clear_bit(KASAN_BIT_MULTI_SHOT, &kasan_flags); 311 + } 312 + EXPORT_SYMBOL_GPL(kasan_restore_multi_shot); 313 + 314 + static int __init kasan_set_multi_shot(char *str) 315 + { 316 + set_bit(KASAN_BIT_MULTI_SHOT, &kasan_flags); 317 + return 1; 318 + } 319 + __setup("kasan_multi_shot", kasan_set_multi_shot); 320 + 321 + static inline bool kasan_report_enabled(void) 322 + { 323 + if (current->kasan_depth) 324 + return false; 325 + if (test_bit(KASAN_BIT_MULTI_SHOT, &kasan_flags)) 326 + return true; 327 + return !test_and_set_bit(KASAN_BIT_REPORTED, &kasan_flags); 296 328 } 297 329 298 330 void kasan_report(unsigned long addr, size_t size,
+1 -1
mm/kmemleak.c
··· 1416 1416 /* data/bss scanning */ 1417 1417 scan_large_block(_sdata, _edata); 1418 1418 scan_large_block(__bss_start, __bss_stop); 1419 - scan_large_block(__start_data_ro_after_init, __end_data_ro_after_init); 1419 + scan_large_block(__start_ro_after_init, __end_ro_after_init); 1420 1420 1421 1421 #ifdef CONFIG_SMP 1422 1422 /* per-cpu sections scanning */
+5 -2
mm/migrate.c
··· 209 209 210 210 VM_BUG_ON_PAGE(PageTail(page), page); 211 211 while (page_vma_mapped_walk(&pvmw)) { 212 - new = page - pvmw.page->index + 213 - linear_page_index(vma, pvmw.address); 212 + if (PageKsm(page)) 213 + new = page; 214 + else 215 + new = page - pvmw.page->index + 216 + linear_page_index(vma, pvmw.address); 214 217 215 218 get_page(new); 216 219 pte = pte_mkold(mk_pte(new, READ_ONCE(vma->vm_page_prot)));
+2 -2
mm/rmap.c
··· 1159 1159 goto out; 1160 1160 } 1161 1161 __mod_node_page_state(page_pgdat(page), NR_FILE_MAPPED, nr); 1162 - mem_cgroup_inc_page_stat(page, MEM_CGROUP_STAT_FILE_MAPPED); 1162 + mem_cgroup_update_page_stat(page, MEM_CGROUP_STAT_FILE_MAPPED, nr); 1163 1163 out: 1164 1164 unlock_page_memcg(page); 1165 1165 } ··· 1199 1199 * pte lock(a spinlock) is held, which implies preemption disabled. 1200 1200 */ 1201 1201 __mod_node_page_state(page_pgdat(page), NR_FILE_MAPPED, -nr); 1202 - mem_cgroup_dec_page_stat(page, MEM_CGROUP_STAT_FILE_MAPPED); 1202 + mem_cgroup_update_page_stat(page, MEM_CGROUP_STAT_FILE_MAPPED, -nr); 1203 1203 1204 1204 if (unlikely(PageMlocked(page))) 1205 1205 clear_page_mlock(page);
+1 -3
mm/vmstat.c
··· 1764 1764 1765 1765 #endif 1766 1766 1767 - static int __init setup_vmstat(void) 1767 + void __init init_mm_internals(void) 1768 1768 { 1769 1769 #ifdef CONFIG_SMP 1770 1770 int ret; ··· 1792 1792 proc_create("vmstat", S_IRUGO, NULL, &proc_vmstat_file_operations); 1793 1793 proc_create("zoneinfo", S_IRUGO, NULL, &proc_zoneinfo_file_operations); 1794 1794 #endif 1795 - return 0; 1796 1795 } 1797 - module_init(setup_vmstat) 1798 1796 1799 1797 #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_COMPACTION) 1800 1798
+1 -1
mm/workingset.c
··· 532 532 pr_info("workingset: timestamp_bits=%d max_order=%d bucket_order=%u\n", 533 533 timestamp_bits, max_order, bucket_order); 534 534 535 - ret = list_lru_init_key(&shadow_nodes, &shadow_nodes_key); 535 + ret = __list_lru_init(&shadow_nodes, true, &shadow_nodes_key); 536 536 if (ret) 537 537 goto err; 538 538 ret = register_shrinker(&workingset_shadow_shrinker);