lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250122090306.1524098-1-brahmajit.xyz@gmail.com>
Date: Wed, 22 Jan 2025 14:33:06 +0530
From: Brahmajit Das <brahmajit.xyz@...il.com>
To: brahmajit.xyz@...il.com,
	david.laight.linux@...il.com
Cc: dhowells@...hat.com,
	linux-kernel@...r.kernel.org,
	netfs@...ts.linux.dev
Subject: [PATCH v2 1/1] cachefiles: fix build with GCC 15

Building with GCC 15 results in the following error

fs/cachefiles/key.c:12:9: error: initializer-string for array of ‘char’ is too long [-Werror=unterminated-string-initialization]
   12 |         "0123456789"                    /* 0 - 9 */
      |         ^~~~~~~~~~~~
cc1: all warnings being treated as errors

This due to GCC 15 having enabled -Wunterminated-string-initialization
by default[0]. Here we're increasing the size of cachefiles_charmap from
64 to 65 to ensure space for NUL. Unfortunately using
__attribute__((nonstring)) or converting to unsigned char [] didn't help
in this case (thanks to David Laight <david.laight.linux@...il.com>).

Please also refer:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117178, and
https://gcc.gnu.org/pipermail/gcc-patches/2024-December/671714.html

[0]:
https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wno-unterminated-string-initialization

Signed-off-by: Brahmajit Das <brahmajit.xyz@...il.com>
---
 fs/cachefiles/key.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/cachefiles/key.c b/fs/cachefiles/key.c
index bf935e25bdbe..a75ea693f649 100644
--- a/fs/cachefiles/key.c
+++ b/fs/cachefiles/key.c
@@ -8,7 +8,7 @@
 #include <linux/slab.h>
 #include "internal.h"
 
-static const char cachefiles_charmap[64] =
+static const char cachefiles_charmap[65] =
 	"0123456789"			/* 0 - 9 */
 	"abcdefghijklmnopqrstuvwxyz"	/* 10 - 35 */
 	"ABCDEFGHIJKLMNOPQRSTUVWXYZ"	/* 36 - 61 */
-- 
2.48.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ