[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <905bb5a8bc3e969ef332dd604864ba67b93e1a85.1758789532.git.xiaopei01@kylinos.cn>
Date: Thu, 25 Sep 2025 16:41:09 +0800
From: Pei Xiao <xiaopei01@...inos.cn>
To: syzbot+62edf7e27b2e8f754525@...kaller.appspotmail.com
Cc: linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com,
Pei Xiao <xiaopei01@...inos.cn>
Subject: [PATCH] KMSAN: uninit-value in n_tty_receive_buf_closing
#syz test
---
drivers/tty/tty_buffer.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c
index 67271fc0b223..62d32556a24b 100644
--- a/drivers/tty/tty_buffer.c
+++ b/drivers/tty/tty_buffer.c
@@ -108,6 +108,7 @@ static void tty_buffer_reset(struct tty_buffer *p, size_t size)
p->lookahead = 0;
p->read = 0;
p->flags = true;
+ memset(p->data, 0, size);
}
/**
@@ -177,7 +178,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;
--
2.25.1
Powered by blists - more mailing lists