linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64/mm: Reject invalid NUMA option
@ 2020-04-24  4:53 Gavin Shan
  2020-04-24 10:11 ` Mark Rutland
  0 siblings, 1 reply; 9+ messages in thread
From: Gavin Shan @ 2020-04-24  4:53 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux-kernel, catalin.marinas, will, mark.rutland, shan.gavin

The NUMA option is parsed by str_has_prefix() and the invalid option
like "numa=o" can be regarded as "numa=off" wrongly.

This fixes the issue with sysfs_streq(), which have more sanity checks,
to avoid accepting the invalid options.

Signed-off-by: Gavin Shan <gshan@redhat.com>
---
 arch/arm64/mm/numa.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c
index 4decf1659700..bd458b28616a 100644
--- a/arch/arm64/mm/numa.c
+++ b/arch/arm64/mm/numa.c
@@ -29,7 +29,8 @@ static __init int numa_parse_early_param(char *opt)
 {
 	if (!opt)
 		return -EINVAL;
-	if (str_has_prefix(opt, "off"))
+
+	if (sysfs_streq(opt, "off"))
 		numa_off = true;
 
 	return 0;
-- 
2.23.0


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

end of thread, other threads:[~2020-04-28  8:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-24  4:53 [PATCH] arm64/mm: Reject invalid NUMA option Gavin Shan
2020-04-24 10:11 ` Mark Rutland
2020-04-28  0:59   ` Gavin Shan
2020-04-28  2:54     ` Steven Rostedt
2020-04-28  2:59       ` Steven Rostedt
2020-04-28  3:09         ` Steven Rostedt
2020-04-28  4:35           ` Gavin Shan
2020-04-28  7:25             ` Will Deacon
2020-04-28  8:56               ` Gavin Shan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).