Skip to contentSkip to conversation

CVE-2026-63876: serial: zs: Convert to use a platform device

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Jul 19

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

serial: zs: Convert to use a platform device

Prevent a crash from happening as the first serial port is initialised:

Console: switching to mono frame buffer device 160x64
fb0: PMAG-AA frame buffer device at tc0
DECstation Z85C30 serial driver version 0.10
CPU 0 Unable to handle kernel paging request at virtual address 0000002c, epc == 803ab00c, ra == 803aafe0 Oops[#1]:

  CPU: 0 PID: 1 Comm: swapper Not tainted 6.4.0-rc3-00031-g84a9582fd203-dirty #57
  $ 0   : 00000000 10012c00 803aaeb0 00000000
  $ 4   : 80e12f60 80e12f50 80e12f58 81000030
  $ 8   : 00000000 805ff37c 00000000 33433538
  $12   : 65732030 00000006 80c2915d 6c616972
  $16   : 80e12f00 807b7630 00000000 00000000
  $20   : 00000004 00000348 000001a0 807623b8
  $24   : 00000018 00000000
  $28   : 80c24000 80c25d60 8078b148 803aafe0
  Hi    : 00000000
  Lo    : 00000000
  epc   : 803ab00c serial_base_ctrl_add+0x78/0xf4
  ra    : 803aafe0 serial_base_ctrl_add+0x4c/0xf4
  Status: 10012c03	KERNEL EXL IE
  Cause : 00000008 (ExcCode 02)
  BadVA : 0000002c
  PrId  : 00000440 (R4400SC)
  Modules linked in:
  Process swapper (pid: 1, threadinfo=(ptrval), task=(ptrval), tls=00000000)
  Stack : 80760000 00000cc0 00400044 00400040 803aa02c 80d61ab8 00000000 807b7630
          80760000 807623b8 807b7628 803aa644 80386998 00000000 80e17780 80220f68
          80e17780 80d61ab8 80c17d80 80e17780 80e17780 8063c798 80e17780 80383fa0
          00000010 80e17780 00000000 80386998 807a0000 00000000 00400040 8038f848
          807623b8 80d61ab8 00000004 80e17780 00000000 803a68e4 80c25e2c 803bb884
          ...
  Call Trace:
  [<803ab00c>] serial_base_ctrl_add+0x78/0xf4
  [<803aa644>] serial_core_register_port+0x174/0x69c
  [<8077e9ac>] zs_init+0xc8/0xfc
  [<800404d4>] do_one_initcall+0x40/0x2ac
  [<8076cecc>] kernel_init_freeable+0x1e4/0x270
  [<80605bec>] kernel_init+0x20/0x108
  [<800431e8>] ret_from_kernel_thread+0x14/0x1c

  Code: 2442aeb0  ae120024  ae0200d0 <8c67002c> 50e00001  8c670000  3c06806e  3c05806e  afb30010

  ---[ end trace 0000000000000000 ]---

(report at the offending commit) -- where a pointer is dereferenced that has been derived from a null pointer to the port's parent device.

Since no device is available with legacy probing and it's not anymore a preferable way to discover devices anyway, switch the driver to using a platform device and use it as the port's parent device. Update resource handling accordingly and only request the actual span of addresses used within the slot, which will have had its resource already requested by generic platform device code.

Use platform_driver_probe() not just because SCC devices are fixed with solder on board and not straightforward to remove, but foremost because the associated TTY's major device number is the same as used by the dz driver and the first driver to claim it will prevent the other one from using it. Either one DZ device or some SCC devices will be present in a given system but never both at a time, and therefore we want the major device number to be claimed by the first driver to actually successfully bind to its device and platform_driver_probe() is a way to fulfil that.

An unfortunate consequence of the switch to a platform device is we now hand the console over from the bootconsole much later in the bootstrap. The firmware console handler appears good enough though to work so late and in particular with interrupts enabled.

Since there is one way only remaining to reach zs_reset() now, remove the port initialisation marker as no longer needed and go through the channel reset unconditionally.

The Linux kernel CVE team has assigned CVE-2026-63876 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 6.5 with commit 84a9582fd203063cd4d301204971ff2cd8327f1a and fixed in 6.6.143 with commit bb2040484f90f91b717060e1a66026cc4287bcf0
	Issue introduced in 6.5 with commit 84a9582fd203063cd4d301204971ff2cd8327f1a and fixed in 6.12.93 with commit 6a83d5e24a84e746425cd93539130e5f7381ef47
	Issue introduced in 6.5 with commit 84a9582fd203063cd4d301204971ff2cd8327f1a and fixed in 6.18.35 with commit 237dc8c08de3cb293b6607aaee8b13b3a671e267
	Issue introduced in 6.5 with commit 84a9582fd203063cd4d301204971ff2cd8327f1a and fixed in 7.0.12 with commit 4dc9f1517503c883d5ce25b7ab29d177d05edc6a
	Issue introduced in 6.5 with commit 84a9582fd203063cd4d301204971ff2cd8327f1a and fixed in 7.1 with commit 7cac59d08a73cb866ec51a483a6f3fe0f531947c

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-63876

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
arch/mips/dec/platform.c
drivers/tty/serial/zs.c
drivers/tty/serial/zs.h

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/bb2040484f90f91b717060e1a66026cc4287bcf0
	https://git.kernel.org/stable/c/6a83d5e24a84e746425cd93539130e5f7381ef47
	https://git.kernel.org/stable/c/237dc8c08de3cb293b6607aaee8b13b3a671e267
	https://git.kernel.org/stable/c/4dc9f1517503c883d5ce25b7ab29d177d05edc6a
	https://git.kernel.org/stable/c/7cac59d08a73cb866ec51a483a6f3fe0f531947c