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 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

Pull s390 fixes from Martin Schwidefsky:
"Three bug fixes:
- The fix for the page table corruption (CVE-2016-2143)
- The diagnose statistics introduced a regression for the dasd diag
driver
- Boot crash on systems without the set-program-parameters facility"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
s390/mm: four page table levels vs. fork
s390/cpumf: Fix lpp detection
s390/dasd: fix diag 0x250 inline assembly

+38 -13
+11 -5
arch/s390/include/asm/mmu_context.h
··· 15 15 static inline int init_new_context(struct task_struct *tsk, 16 16 struct mm_struct *mm) 17 17 { 18 + spin_lock_init(&mm->context.list_lock); 19 + INIT_LIST_HEAD(&mm->context.pgtable_list); 20 + INIT_LIST_HEAD(&mm->context.gmap_list); 18 21 cpumask_clear(&mm->context.cpu_attach_mask); 19 22 atomic_set(&mm->context.attach_count, 0); 20 23 mm->context.flush_mm = 0; 21 - mm->context.asce_bits = _ASCE_TABLE_LENGTH | _ASCE_USER_BITS; 22 - mm->context.asce_bits |= _ASCE_TYPE_REGION3; 23 24 #ifdef CONFIG_PGSTE 24 25 mm->context.alloc_pgste = page_table_allocate_pgste; 25 26 mm->context.has_pgste = 0; 26 27 mm->context.use_skey = 0; 27 28 #endif 28 - mm->context.asce_limit = STACK_TOP_MAX; 29 + if (mm->context.asce_limit == 0) { 30 + /* context created by exec, set asce limit to 4TB */ 31 + mm->context.asce_bits = _ASCE_TABLE_LENGTH | 32 + _ASCE_USER_BITS | _ASCE_TYPE_REGION3; 33 + mm->context.asce_limit = STACK_TOP_MAX; 34 + } else if (mm->context.asce_limit == (1UL << 31)) { 35 + mm_inc_nr_pmds(mm); 36 + } 29 37 crst_table_init((unsigned long *) mm->pgd, pgd_entry_type(mm)); 30 38 return 0; 31 39 } ··· 119 111 static inline void arch_dup_mmap(struct mm_struct *oldmm, 120 112 struct mm_struct *mm) 121 113 { 122 - if (oldmm->context.asce_limit < mm->context.asce_limit) 123 - crst_table_downgrade(mm, oldmm->context.asce_limit); 124 114 } 125 115 126 116 static inline void arch_exit_mmap(struct mm_struct *mm)
+19 -5
arch/s390/include/asm/pgalloc.h
··· 100 100 101 101 static inline pgd_t *pgd_alloc(struct mm_struct *mm) 102 102 { 103 - spin_lock_init(&mm->context.list_lock); 104 - INIT_LIST_HEAD(&mm->context.pgtable_list); 105 - INIT_LIST_HEAD(&mm->context.gmap_list); 106 - return (pgd_t *) crst_table_alloc(mm); 103 + unsigned long *table = crst_table_alloc(mm); 104 + 105 + if (!table) 106 + return NULL; 107 + if (mm->context.asce_limit == (1UL << 31)) { 108 + /* Forking a compat process with 2 page table levels */ 109 + if (!pgtable_pmd_page_ctor(virt_to_page(table))) { 110 + crst_table_free(mm, table); 111 + return NULL; 112 + } 113 + } 114 + return (pgd_t *) table; 107 115 } 108 - #define pgd_free(mm, pgd) crst_table_free(mm, (unsigned long *) pgd) 116 + 117 + static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) 118 + { 119 + if (mm->context.asce_limit == (1UL << 31)) 120 + pgtable_pmd_page_dtor(virt_to_page(pgd)); 121 + crst_table_free(mm, (unsigned long *) pgd); 122 + } 109 123 110 124 static inline void pmd_populate(struct mm_struct *mm, 111 125 pmd_t *pmd, pgtable_t pte)
+1 -1
arch/s390/kernel/head64.S
··· 16 16 17 17 __HEAD 18 18 ENTRY(startup_continue) 19 - tm __LC_STFLE_FAC_LIST+6,0x80 # LPP available ? 19 + tm __LC_STFLE_FAC_LIST+5,0x80 # LPP available ? 20 20 jz 0f 21 21 xc __LC_LPP+1(7,0),__LC_LPP+1 # clear lpp and current_pid 22 22 mvi __LC_LPP,0x80 # and set LPP_MAGIC
+7 -2
drivers/s390/block/dasd_diag.c
··· 67 67 * and function code cmd. 68 68 * In case of an exception return 3. Otherwise return result of bitwise OR of 69 69 * resulting condition code and DIAG return code. */ 70 - static inline int dia250(void *iob, int cmd) 70 + static inline int __dia250(void *iob, int cmd) 71 71 { 72 72 register unsigned long reg2 asm ("2") = (unsigned long) iob; 73 73 typedef union { ··· 77 77 int rc; 78 78 79 79 rc = 3; 80 - diag_stat_inc(DIAG_STAT_X250); 81 80 asm volatile( 82 81 " diag 2,%2,0x250\n" 83 82 "0: ipm %0\n" ··· 88 89 : "d" (cmd), "d" (reg2), "m" (*(addr_type *) iob) 89 90 : "3", "cc"); 90 91 return rc; 92 + } 93 + 94 + static inline int dia250(void *iob, int cmd) 95 + { 96 + diag_stat_inc(DIAG_STAT_X250); 97 + return __dia250(iob, cmd); 91 98 } 92 99 93 100 /* Initialize block I/O to DIAG device using the specified blocksize and