public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ext4: avoid -Wformat-security warning
@ 2025-04-23 16:43 Arnd Bergmann
  2025-04-24 11:39 ` Jan Kara
  2025-05-20 14:40 ` Theodore Ts'o
  0 siblings, 2 replies; 5+ messages in thread
From: Arnd Bergmann @ 2025-04-23 16:43 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger
  Cc: Arnd Bergmann, Jan Kara, Zhang Yi, Ojaswin Mujoo, Darrick J. Wong,
	Matthew Wilcox (Oracle), Ritesh Harjani (IBM), Shida Zhang,
	Baokun Li, Jann Horn, Brian Foster, linux-ext4, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

check_igot_inode() prints a variable string, which causes a harmless
warning with 'make W=1':

fs/ext4/inode.c:4763:45: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
 4763 |         ext4_error_inode(inode, function, line, 0, err_str);

Use a trivial "%s" format string instead.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/ext4/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 94c7d2d828a6..3cfb1b670ea4 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -4760,7 +4760,7 @@ static int check_igot_inode(struct inode *inode, ext4_iget_flags flags,
 	return 0;
 
 error:
-	ext4_error_inode(inode, function, line, 0, err_str);
+	ext4_error_inode(inode, function, line, 0, "%s", err_str);
 	return -EFSCORRUPTED;
 }
 
-- 
2.39.5


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

end of thread, other threads:[~2025-05-20 14:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-23 16:43 [PATCH] ext4: avoid -Wformat-security warning Arnd Bergmann
2025-04-24 11:39 ` Jan Kara
2025-04-24 12:31   ` Arnd Bergmann
2025-04-24 13:48     ` Jan Kara
2025-05-20 14:40 ` Theodore Ts'o

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