[PATCH 0/4] tty: fix a stack overread and missing locking in serial drivers

From: Praneeth Balasubramanian

Date: Sat Dec 05 2026 - 01:35:53 EST


These 4 patches fix bugs that an LLM-based audit found. The audit checks
code against the rules stated in kernel comments, such as "the caller
must hold this lock" or "drop the reference when done". Each changelog
explains the rule and the path that breaks it.

The patches are independent of each other, and each one can be applied
on its own. They are against next-20261204 and also apply to mainline
(007722b8211f).

None of them was runtime-tested. There is no reproducer, and I do not
have the hardware. Each one builds without new warnings with W=1, and
checkpatch.pl is clean. Details are below the --- of each patch.

Tools: GLM-5.3 drafted the fixes and changelogs. Claude Opus 5.5 checked
each one against the source and rewrote parts where needed. I reviewed
every patch.

Praneeth Balasubramanian (4):
tty: hvsi: fix stack overread in hvsi_version_respond()
serial: men_z135_uart: do not release an unrequested memory region
tty: atmel_serial: take the port lock in console write
mxser: take termios_rwsem in mxser_set_serial_info()

drivers/tty/hvc/hvsi.c | 7 +++++--
drivers/tty/mxser.c | 1 +
drivers/tty/serial/atmel_serial.c | 15 ++++++++++++---
drivers/tty/serial/men_z135_uart.c | 7 +++++--
4 files changed, 23 insertions(+), 7 deletions(-)


base-commit: 29beb21c21ada7207692b2d69fc58dcd15dab6e9
--
2.25.1