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

Pull s390 fixes from Heiko Carstens:

- With CONFIG_VMAP_STACK enabled it is not possible to load the s390
specific diag288_wdt watchdog module. The reason is that a pointer to
a string is passed to an inline assembly; this string however is
located on the stack, while the instruction within the inline
assembly expects a physicial address. Fix this by copying the string
to a kmalloc'ed buffer.

- The diag288_wdt watchdog module does not indicate that it accesses
memory from an inline assembly, which it does. Add "memory" to the
clobber list to prevent the compiler from optimizing code incorrectly
away.

- Pass size of the uncompressed kernel image to __decompress() call.
Otherwise the kernel image decompressor may corrupt/overwrite an
initrd. This was reported to happen on s390 after commit 2aa14b1ab2c4
("zstd: import usptream v1.5.2").

* tag 's390-6.2-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
s390/decompressor: specify __decompress() buf len to avoid overflow
watchdog: diag288_wdt: fix __diag288() inline assembly
watchdog: diag288_wdt: do not use stack buffers for hardware data

+13 -4
+1 -1
arch/s390/boot/decompressor.c
··· 80 80 void *output = (void *)decompress_offset; 81 81 82 82 __decompress(_compressed_start, _compressed_end - _compressed_start, 83 - NULL, NULL, output, 0, NULL, error); 83 + NULL, NULL, output, vmlinux.image_size, NULL, error); 84 84 return output; 85 85 }
+12 -3
drivers/watchdog/diag288_wdt.c
··· 86 86 "1:\n" 87 87 EX_TABLE(0b, 1b) 88 88 : "+d" (err) : "d"(__func), "d"(__timeout), 89 - "d"(__action), "d"(__len) : "1", "cc"); 89 + "d"(__action), "d"(__len) : "1", "cc", "memory"); 90 90 return err; 91 91 } 92 92 ··· 268 268 char ebc_begin[] = { 269 269 194, 197, 199, 201, 213 270 270 }; 271 + char *ebc_cmd; 271 272 272 273 watchdog_set_nowayout(&wdt_dev, nowayout_info); 273 274 274 275 if (MACHINE_IS_VM) { 275 - if (__diag288_vm(WDT_FUNC_INIT, 15, 276 - ebc_begin, sizeof(ebc_begin)) != 0) { 276 + ebc_cmd = kmalloc(sizeof(ebc_begin), GFP_KERNEL); 277 + if (!ebc_cmd) { 278 + pr_err("The watchdog cannot be initialized\n"); 279 + return -ENOMEM; 280 + } 281 + memcpy(ebc_cmd, ebc_begin, sizeof(ebc_begin)); 282 + ret = __diag288_vm(WDT_FUNC_INIT, 15, 283 + ebc_cmd, sizeof(ebc_begin)); 284 + kfree(ebc_cmd); 285 + if (ret != 0) { 277 286 pr_err("The watchdog cannot be initialized\n"); 278 287 return -EINVAL; 279 288 }