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 'powerpc-4.19-4' of https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Michael writes:
"powerpc fixes for 4.19 #4

Four regression fixes.

A fix for a change to lib/xz which broke our zImage loader when
building with XZ compression. OK'ed by Herbert who merged the
original patch.

The recent fix we did to avoid patching __init text broke some 32-bit
machines, fix that.

Our show_user_instructions() could be tricked into printing kernel
memory, add a check to avoid that.

And a fix for a change to our NUMA initialisation logic, which causes
crashes in some kdump configurations.

Thanks to:
Christophe Leroy, Hari Bathini, Jann Horn, Joel Stanley, Meelis
Roos, Murilo Opsfelder Araujo, Srikar Dronamraju."

* tag 'powerpc-4.19-4' of https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/numa: Skip onlining a offline node in kdump path
powerpc: Don't print kernel instructions in show_user_instructions()
powerpc/lib: fix book3s/32 boot failure due to code patching
lib/xz: Put CRC32_POLY_LE in xz_private.h

+29 -11
+10
arch/powerpc/kernel/process.c
··· 1306 1306 1307 1307 pc = regs->nip - (instructions_to_print * 3 / 4 * sizeof(int)); 1308 1308 1309 + /* 1310 + * Make sure the NIP points at userspace, not kernel text/data or 1311 + * elsewhere. 1312 + */ 1313 + if (!__access_ok(pc, instructions_to_print * sizeof(int), USER_DS)) { 1314 + pr_info("%s[%d]: Bad NIP, not dumping instructions.\n", 1315 + current->comm, current->pid); 1316 + return; 1317 + } 1318 + 1309 1319 pr_info("%s[%d]: code: ", current->comm, current->pid); 1310 1320 1311 1321 for (i = 0; i < instructions_to_print; i++) {
+12 -8
arch/powerpc/lib/code-patching.c
··· 28 28 { 29 29 int err; 30 30 31 - /* Make sure we aren't patching a freed init section */ 32 - if (init_mem_is_free && init_section_contains(exec_addr, 4)) { 33 - pr_debug("Skipping init section patching addr: 0x%px\n", exec_addr); 34 - return 0; 35 - } 36 - 37 31 __put_user_size(instr, patch_addr, 4, err); 38 32 if (err) 39 33 return err; ··· 142 148 return 0; 143 149 } 144 150 145 - int patch_instruction(unsigned int *addr, unsigned int instr) 151 + static int do_patch_instruction(unsigned int *addr, unsigned int instr) 146 152 { 147 153 int err; 148 154 unsigned int *patch_addr = NULL; ··· 182 188 } 183 189 #else /* !CONFIG_STRICT_KERNEL_RWX */ 184 190 185 - int patch_instruction(unsigned int *addr, unsigned int instr) 191 + static int do_patch_instruction(unsigned int *addr, unsigned int instr) 186 192 { 187 193 return raw_patch_instruction(addr, instr); 188 194 } 189 195 190 196 #endif /* CONFIG_STRICT_KERNEL_RWX */ 197 + 198 + int patch_instruction(unsigned int *addr, unsigned int instr) 199 + { 200 + /* Make sure we aren't patching a freed init section */ 201 + if (init_mem_is_free && init_section_contains(addr, 4)) { 202 + pr_debug("Skipping init section patching addr: 0x%px\n", addr); 203 + return 0; 204 + } 205 + return do_patch_instruction(addr, instr); 206 + } 191 207 NOKPROBE_SYMBOL(patch_instruction); 192 208 193 209 int patch_branch(unsigned int *addr, unsigned long target, int flags)
+3 -2
arch/powerpc/mm/numa.c
··· 1217 1217 * Need to ensure that NODE_DATA is initialized for a node from 1218 1218 * available memory (see memblock_alloc_try_nid). If unable to 1219 1219 * init the node, then default to nearest node that has memory 1220 - * installed. 1220 + * installed. Skip onlining a node if the subsystems are not 1221 + * yet initialized. 1221 1222 */ 1222 - if (try_online_node(new_nid)) 1223 + if (!topology_inited || try_online_node(new_nid)) 1223 1224 new_nid = first_online_node; 1224 1225 #else 1225 1226 /*
-1
lib/xz/xz_crc32.c
··· 15 15 * but they are bigger and use more memory for the lookup table. 16 16 */ 17 17 18 - #include <linux/crc32poly.h> 19 18 #include "xz_private.h" 20 19 21 20 /*
+4
lib/xz/xz_private.h
··· 102 102 # endif 103 103 #endif 104 104 105 + #ifndef CRC32_POLY_LE 106 + #define CRC32_POLY_LE 0xedb88320 107 + #endif 108 + 105 109 /* 106 110 * Allocate memory for LZMA2 decoder. xz_dec_lzma2_reset() must be used 107 111 * before calling xz_dec_lzma2_run().