Skip to contentSkip to conversation

params-fix-the-maximum-length-in-param_get_string.patch removed from -mm tree

merged [email protected] 1 participant 1 message Oct 4, 2017

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: kernel/params.c: fix the maximum length in param_get_string
has been removed from the -mm tree. Its filename was
params-fix-the-maximum-length-in-param_get_string.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Jean Delvare <[email protected]>
Subject: kernel/params.c: fix the maximum length in param_get_string

The length parameter of strlcpy() is supposed to reflect the size of the target buffer, not of the source string. Harmless in this case as the buffer is PAGE_SIZE long and the source string is always much shorter than this, but conceptually wrong, so let's fix it.

---

 kernel/params.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/params.c renamed from kernel/params.c~params-fix-the-maximum-length-in-param_get_string +1 -1
diff -puN kernel/params.c~params-fix-the-maximum-length-in-param_get_string kernel/params.c
@@ -507,7 +507,7 @@ EXPORT_SYMBOL(param_set_copystring);
 int param_get_string(char *buffer, const struct kernel_param *kp)
 {
 	const struct kparam_string *kps = kp->str;
-	return strlcpy(buffer, kps->string, kps->maxlen);
+	return strlcpy(buffer, kps->string, PAGE_SIZE);
 }
 EXPORT_SYMBOL(param_get_string);
 

_

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