Skip to contentSkip to conversation

selftests-proc-fix-string-literal-warning-in-proc-maps-racec.patch removed from -mm tree

merged mm-hotfixes-stable Andrew Morton 1 participant 1 message Aug 12, 2025

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: selftests/proc: fix string literal warning in proc-maps-race.c
has been removed from the -mm tree. Its filename was
selftests-proc-fix-string-literal-warning-in-proc-maps-racec.patch

This patch was dropped because it was merged into the mm-hotfixes-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Sukrut Heroorkar <[email protected]>
Subject: selftests/proc: fix string literal warning in proc-maps-race.c
Date: Tue, 5 Aug 2025 00:56:14 +0200

This change resolves non literal string format warning invoked for proc-maps-race.c while compiling.

proc-maps-race.c:205:17: warning: format not a string literal and no format arguments [-Wformat-security]

 205 |                 printf(text);
     |                 ^~~~~~
proc-maps-race.c:209:17: warning: format not a string literal and no format arguments [-Wformat-security]
 209 |                 printf(text);
     |                 ^~~~~~
proc-maps-race.c: In function `print_last_lines':
proc-maps-race.c:224:9: warning: format not a string literal and no format arguments [-Wformat-security]
 224 |         printf(start);
     |         ^~~~~~

Add string format specifier %s for the printf calls in both print_first_lines() and print_last_lines() thus resolving the warnings.

The test executes fine after this change thus causing no effect to the functional behavior of the test.

Fixes aadc099c480f ("selftests/proc: add verbose mode for /proc/pid/maps tearing tests")
Cc David Hunter <[email protected]>
Cc Shuah Khan <[email protected]>

---

 tools/testing/selftests/proc/proc-maps-race.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tools/testing/selftests/proc/proc-maps-race.c renamed from tools/testing/selftests/proc/proc-maps-race.c~selftests-proc-fix-string-literal-warning-in-proc-maps-racec +3 -3
@@ -202,11 +202,11 @@ static void print_first_lines(char *text
 		int offs = end - text;
 
 		text[offs] = '\0';
-		printf(text);
+		printf("%s", text);
 		text[offs] = '\n';
 		printf("\n");
 	} else {
-		printf(text);
+		printf("%s", text);
 	}
 }
 
@@ -221,7 +221,7 @@ static void print_last_lines(char *text,
 		nr--;
 		start--;
 	}
-	printf(start);
+	printf("%s", start);
 }
 
 static void print_boundaries(const char *title, FIXTURE_DATA(proc_maps_race) *self)

_

Patches currently in -mm which might be from [email protected] are