Forwarded: KMSAN: uninit-value in n_tty_receive_buf_closing (3)

From: syzbot
Date: Thu Sep 25 2025 - 01:40:51 EST


For archival purposes, forwarding an incoming command email to
linux-kernel@xxxxxxxxxxxxxxx.

***

Subject: KMSAN: uninit-value in n_tty_receive_buf_closing (3)
Author: rampxxxx@xxxxxxxxx

#syz test

---

diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c
index 79f0ff94ce00..b297e3fafdf7 100644
--- a/drivers/tty/tty_buffer.c
+++ b/drivers/tty/tty_buffer.c
@@ -177,7 +177,7 @@ static struct tty_buffer *tty_buffer_alloc(struct
tty_port *port, size_t size)
*/
if (atomic_read(&port->buf.mem_used) > port->buf.mem_limit)
return NULL;
- p = kmalloc(struct_size(p, data, 2 * size), GFP_ATOMIC | __GFP_NOWARN);
+ p = kzalloc(struct_size(p, data, 2 * size), GFP_ATOMIC | __GFP_NOWARN);
if (p == NULL)
return NULL;