# CVE-2025-40222: tty: serial: sh-sci: fix RSCI FIFO overrun handling

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **EPSS:** 0.26% (percentile 11, 2026-11-26)
- **Published:** 2025-12-04T15:31:14.142Z
- **Modified:** 2026-10-19T19:10:00.130Z

## Who should check

- Anyone running Linux \>= 0666e3fe95ab55c295984f2f51277ec27d3f190c, \< 2ec9bbd09a6cdf5b8c726be34f29630faf585d07; \>= 0666e3fe95ab55c295984f2f51277ec27d3f190c, \< ef8fef45c74b5a0059488fda2df65fa133f7d7d0
- Anyone running Linux 6.17

## Description

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

tty: serial: sh-sci: fix RSCI FIFO overrun handling

The receive error handling code is shared between RSCI and all other
SCIF port types, but the RSCI overrun\_reg is specified as a memory
offset, while for other SCIF types it is an enum value used to index
into the sci\_port\_params-\>regs array, as mentioned above the
sci\_serial\_in() function.

For RSCI, the overrun\_reg is CSR (0x48), causing the sci\_getreg() call
inside the sci\_handle\_fifo\_overrun() function to index outside the
bounds of the regs array, which currently has a size of 20, as specified
by SCI\_NR\_REGS.

Because of this, we end up accessing memory outside of RSCI's
rsci\_port\_params structure, which, when interpreted as a plat\_sci\_reg,
happens to have a non-zero size, causing the following WARN when
sci\_serial\_in() is called, as the accidental size does not match the
supported register sizes.

The existence of the overrun\_reg needs to be checked because
SCIx\_SH3\_SCIF\_REGTYPE has overrun\_reg set to SCLSR, but SCLSR is not
present in the regs array.

Avoid calling sci\_getreg() for port types which don't use standard
register handling.

Use the ops-\>read\_reg() and ops-\>write\_reg() functions to properly read
and write registers for RSCI, and change the type of the status variable
to accommodate the 32-bit CSR register.

sci\_getreg() and sci\_serial\_in() are also called with overrun\_reg in the
sci\_mpxed\_interrupt() interrupt handler, but that code path is not used
for RSCI, as it does not have a muxed interrupt.

------------\[ cut here \]------------
Invalid register access
WARNING: CPU: 0 PID: 0 at drivers/tty/serial/sh-sci.c:522 sci\_serial\_in+0x38/0xac
Modules linked in: renesas\_usbhs at24 rzt2h\_adc industrialio\_adc sha256 cfg80211 bluetooth ecdh\_generic ecc rfkill fuse drm backlight ipv6
CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Not tainted 6.17.0-rc1+ \#30 PREEMPT
Hardware name: Renesas RZ/T2H EVK Board based on r9a09g077m44 (DT)
pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : sci\_serial\_in+0x38/0xac
lr : sci\_serial\_in+0x38/0xac
sp : ffff800080003e80
x29: ffff800080003e80 x28: ffff800082195b80 x27: 000000000000000d
x26: ffff8000821956d0 x25: 0000000000000000 x24: ffff800082195b80
x23: ffff000180e0d800 x22: 0000000000000010 x21: 0000000000000000
x20: 0000000000000010 x19: ffff000180e72000 x18: 000000000000000a
x17: ffff8002bcee7000 x16: ffff800080000000 x15: 0720072007200720
x14: 0720072007200720 x13: 0720072007200720 x12: 0720072007200720
x11: 0000000000000058 x10: 0000000000000018 x9 : ffff8000821a6a48
x8 : 0000000000057fa8 x7 : 0000000000000406 x6 : ffff8000821fea48
x5 : ffff00033ef88408 x4 : ffff8002bcee7000 x3 : ffff800082195b80
x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff800082195b80
Call trace:
 sci\_serial\_in+0x38/0xac (P)
 sci\_handle\_fifo\_overrun.isra.0+0x70/0x134
 sci\_er\_interrupt+0x50/0x39c
 \_\_handle\_irq\_event\_percpu+0x48/0x140
 handle\_irq\_event+0x44/0xb0
 handle\_fasteoi\_irq+0xf4/0x1a0
 handle\_irq\_desc+0x34/0x58
 generic\_handle\_domain\_irq+0x1c/0x28
 gic\_handle\_irq+0x4c/0x140
 call\_on\_irq\_stack+0x30/0x48
 do\_interrupt\_handler+0x80/0x84
 el1\_interrupt+0x34/0x68
 el1h\_64\_irq\_handler+0x18/0x24
 el1h\_64\_irq+0x6c/0x70
 default\_idle\_call+0x28/0x58 (P)
 do\_idle+0x1f8/0x250
 cpu\_startup\_entry+0x34/0x3c
 rest\_init+0xd8/0xe0
 console\_on\_rootfs+0x0/0x6c
 \_\_primary\_switched+0x88/0x90
---\[ end trace 0000000000000000 \]---

## Affected and fixed versions

- Linux: \>= 0666e3fe95ab55c295984f2f51277ec27d3f190c, \< 2ec9bbd09a6cdf5b8c726be34f29630faf585d07; \>= 0666e3fe95ab55c295984f2f51277ec27d3f190c, \< ef8fef45c74b5a0059488fda2df65fa133f7d7d0 (cvelist)
- Linux: 6.17 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-40222. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-40222.md
Affected: Linux >= 0666e3fe95ab55c295984f2f51277ec27d3f190c, < 2ec9bbd09a6cdf5b8c726be34f29630faf585d07; >= 0666e3fe95ab55c295984f2f51277ec27d3f190c, < ef8fef45c74b5a0059488fda2df65fa133f7d7d0; Linux 6.17
Fixed in: Linux 2ec9bbd09a6cdf5b8c726be34f29630faf585d07

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-40222 being exploited?

There is no confirmed exploitation: CVE-2025-40222 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.26% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-40222?

It has no CVSS score yet. Unknown.

### Which versions are affected by CVE-2025-40222?

Linux \>= 0666e3fe95ab55c295984f2f51277ec27d3f190c, \< 2ec9bbd09a6cdf5b8c726be34f29630faf585d07; \>= 0666e3fe95ab55c295984f2f51277ec27d3f190c, \< ef8fef45c74b5a0059488fda2df65fa133f7d7d0; Linux 6.17.

### Is there a fix for CVE-2025-40222?

Yes. Fixed in Linux 2ec9bbd09a6cdf5b8c726be34f29630faf585d07. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2025-40222?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- other: <https://git.kernel.org/stable/c/2ec9bbd09a6cdf5b8c726be34f29630faf585d07>
- other: <https://git.kernel.org/stable/c/ef8fef45c74b5a0059488fda2df65fa133f7d7d0>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-40222>

HTML: <https://flawdb.com/CVE-2025-40222> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-40222>
