Linux filesystem development
 help / color / mirror / Atom feed
* [PATCH] fs: Fix uninitialized value issue in from_kuid
@ 2024-10-16 12:37 Alessandro Zanni
  2024-10-16 13:23 ` Jan Kara
  0 siblings, 1 reply; 5+ messages in thread
From: Alessandro Zanni @ 2024-10-16 12:37 UTC (permalink / raw)
  To: viro, brauner, jack
  Cc: Alessandro Zanni, linux-fsdevel, linux-kernel, skhan,
	anupnewsmail, alessandrozanni.dev, syzbot+6c55f725d1bdc8c52058

Fix uninitialized value issue in from_kuid by initializing the newattrs
structure in do_truncate() method.

Fixes: uninit-value in from_kuid reported here
 https://syzkaller.appspot.com/bug?extid=6c55f725d1bdc8c52058
Reported-by: syzbot+6c55f725d1bdc8c52058@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=6c55f725d1bdc8c52058
Signed-off-by: Alessandro Zanni <alessandro.zanni87@gmail.com>
---
 fs/open.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/open.c b/fs/open.c
index acaeb3e25c88..57c298b1db2c 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -40,7 +40,7 @@ int do_truncate(struct mnt_idmap *idmap, struct dentry *dentry,
 		loff_t length, unsigned int time_attrs, struct file *filp)
 {
 	int ret;
-	struct iattr newattrs;
+	struct iattr newattrs = {0};
 
 	/* Not pretty: "inode->i_size" shouldn't really be signed. But it is. */
 	if (length < 0)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-10-17  9:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-16 12:37 [PATCH] fs: Fix uninitialized value issue in from_kuid Alessandro Zanni
2024-10-16 13:23 ` Jan Kara
2024-10-16 14:52   ` Christian Brauner
2024-10-17  9:22     ` Alessandro Zanni
2024-10-17  9:58       ` Jan Kara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox