Commit d8cb0683 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull s390 updates from Heiko Carstens:

 - Large rework of the protected key crypto code to allow for
   asynchronous handling without memory allocation

 - Speed up system call entry/exit path by re-implementing lazy ASCE
   handling

 - Add module autoload support for the diag288_wdt watchdog device
   driver

 - Get rid of s390 specific strcpy() and strncpy() implementations, and
   switch all remaining users to strscpy() when possible

 - Various other small fixes and improvements

* tag 's390-6.16-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (51 commits)
  s390/pci: Serialize device addition and removal
  s390/pci: Allow re-add of a reserved but not yet removed device
  s390/pci: Prevent self deletion in disable_slot()
  s390/pci: Remove redundant bus removal and disable from zpci_release_device()
  s390/crypto: Extend protected key conversion retry loop
  s390/pci: Fix __pcilg_mio_inuser() inline assembly
  s390/ptrace: Always inline regs_get_kernel_stack_nth() and regs_get_register()
  s390/thread_info: Cleanup header includes
  s390/extmem: Add workaround for DCSS unload diag
  s390/crypto: Rework protected key AES for true asynch support
  s390/cpacf: Rework cpacf_pcc() to return condition code
  s390/mm: Fix potential use-after-free in __crst_table_upgrade()
  s390/mm: Add mmap_assert_write_locked() check to crst_table_upgrade()
  s390/string: Remove strcpy() implementation
  s390/con3270: Use strscpy() instead of strcpy()
  s390/boot: Use strspcy() instead of strcpy()
  s390: Simple strcpy() to strscpy() conversions
  s390/pkey/crypto: Introduce xflags param for pkey in-kernel API
  s390/pkey: Provide and pass xflags within pkey and zcrypt layers
  s390/uv: Remove uv_get_secret_metadata function
  ...
parents ba450370 774a1fa8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -146,6 +146,7 @@ config S390
	select ARCH_WANTS_NO_INSTR
	select ARCH_WANT_DEFAULT_BPF_JIT
	select ARCH_WANT_IPC_PARSE_VERSION
	select ARCH_WANT_IRQS_OFF_ACTIVATE_MM
	select ARCH_WANT_KERNEL_PMD_MKWRITE
	select ARCH_WANT_LD_ORPHAN_WARN
	select ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP
+4 −3
Original line number Diff line number Diff line
@@ -179,7 +179,7 @@ void setup_boot_command_line(void)
	if (has_ebcdic_char(parmarea.command_line))
		EBCASC(parmarea.command_line, COMMAND_LINE_SIZE);
	/* copy arch command line */
	strcpy(early_command_line, strim(parmarea.command_line));
	strscpy(early_command_line, strim(parmarea.command_line));

	/* append IPL PARM data to the boot command line */
	if (!is_prot_virt_guest() && ipl_block_valid)
@@ -253,7 +253,8 @@ void parse_boot_command_line(void)
	int rc;

	__kaslr_enabled = IS_ENABLED(CONFIG_RANDOMIZE_BASE);
	args = strcpy(command_line_buf, early_command_line);
	strscpy(command_line_buf, early_command_line);
	args = command_line_buf;
	while (*args) {
		args = next_arg(args, &param, &val);

@@ -309,7 +310,7 @@ void parse_boot_command_line(void)
		if (!strcmp(param, "bootdebug")) {
			bootdebug = true;
			if (val)
				strncpy(bootdebug_filter, val, sizeof(bootdebug_filter) - 1);
				strscpy(bootdebug_filter, val);
		}
		if (!strcmp(param, "quiet"))
			boot_console_loglevel = CONSOLE_LOGLEVEL_QUIET;
+4 −3
Original line number Diff line number Diff line
@@ -29,7 +29,8 @@ static void boot_rb_add(const char *str, size_t len)
	/* store strings separated by '\0' */
	if (len + 1 > avail)
		boot_rb_off = 0;
	strcpy(boot_rb + boot_rb_off, str);
	avail = sizeof(boot_rb) - boot_rb_off - 1;
	strscpy(boot_rb + boot_rb_off, str, avail);
	boot_rb_off += len + 1;
}

@@ -158,10 +159,10 @@ static noinline char *strsym(char *buf, void *ip)

	p = findsym((unsigned long)ip, &off, &len);
	if (p) {
		strncpy(buf, p, MAX_SYMLEN);
		strscpy(buf, p, MAX_SYMLEN);
		/* reserve 15 bytes for offset/len in symbol+0x1234/0x1234 */
		p = buf + strnlen(buf, MAX_SYMLEN - 15);
		strcpy(p, "+0x");
		strscpy(p, "+0x", MAX_SYMLEN - (p - buf));
		as_hex(p + 3, off, 0);
		strcat(p, "/0x");
		as_hex(p + strlen(p), len, 0);
+17 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
#include <asm/boot_data.h>
#include <asm/extmem.h>
#include <asm/sections.h>
#include <asm/diag288.h>
#include <asm/maccess.h>
#include <asm/machine.h>
#include <asm/sysinfo.h>
@@ -71,6 +72,20 @@ static void detect_machine_type(void)
		set_machine_feature(MFEATURE_VM);
}

static void detect_diag288(void)
{
	/* "BEGIN" in EBCDIC character set */
	static const char cmd[] = "\xc2\xc5\xc7\xc9\xd5";
	unsigned long action, len;

	action = machine_is_vm() ? (unsigned long)cmd : LPARWDT_RESTART;
	len = machine_is_vm() ? sizeof(cmd) : 0;
	if (__diag288(WDT_FUNC_INIT, MIN_INTERVAL, action, len))
		return;
	__diag288(WDT_FUNC_CANCEL, 0, 0, 0);
	set_machine_feature(MFEATURE_DIAG288);
}

static void detect_diag9c(void)
{
	unsigned int cpu;
@@ -519,6 +534,8 @@ void startup_kernel(void)
	detect_facilities();
	detect_diag9c();
	detect_machine_type();
	/* detect_diag288() needs machine type */
	detect_diag288();
	cmma_init();
	sanitize_prot_virt_host();
	max_physmem_end = detect_max_physmem_end();
+12 −0
Original line number Diff line number Diff line
@@ -29,6 +29,18 @@ int strncmp(const char *cs, const char *ct, size_t count)
	return 0;
}

ssize_t sized_strscpy(char *dst, const char *src, size_t count)
{
	size_t len;

	if (count == 0)
		return -E2BIG;
	len = strnlen(src, count - 1);
	memcpy(dst, src, len);
	dst[len] = '\0';
	return src[len] ? -E2BIG : len;
}

void *memset64(uint64_t *s, uint64_t v, size_t count)
{
	uint64_t *xs = s;
Loading