From: Greg Kroah-Hartman Date: Mon, 19 Nov 2007 17:26:44 +0000 (-0800) Subject: another 2.6.22 patch X-Git-Tag: v2.6.22.14~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=11976821d1a8eab12e81ab5c4b485f94b44055c9;p=thirdparty%2Fkernel%2Fstable-queue.git another 2.6.22 patch --- diff --git a/queue-2.6.22/fix-param_sysfs_builtin-name-length-check.patch b/queue-2.6.22/fix-param_sysfs_builtin-name-length-check.patch new file mode 100644 index 00000000000..41a5abbddf0 --- /dev/null +++ b/queue-2.6.22/fix-param_sysfs_builtin-name-length-check.patch @@ -0,0 +1,54 @@ +From 22800a2830ec07e7cc5c837999890ac47cc7f5de Mon Sep 17 00:00:00 2001 +From: Jan Kiszka +Date: Wed, 14 Nov 2007 17:00:08 -0800 +Subject: [PATCH] fix param_sysfs_builtin name length check + +From: Jan Kiszka + +patch 22800a2830ec07e7cc5c837999890ac47cc7f5de in mainline. + +Commit faf8c714f4508207a9c81cc94dafc76ed6680b44 caused a regression: +parameter names longer than MAX_KBUILD_MODNAME will now be rejected, +although we just need to keep the module name part that short. This patch +restores the old behaviour while still avoiding that memchr is called with +its length parameter larger than the total string length. + +Signed-off-by: Jan Kiszka +Cc: Dave Young +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Cc: Chuck Ebbert +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/params.c | 15 ++++++--------- + 1 file changed, 6 insertions(+), 9 deletions(-) + +--- a/kernel/params.c ++++ b/kernel/params.c +@@ -591,19 +591,16 @@ static void __init param_sysfs_builtin(v + + for (i=0; i < __stop___param - __start___param; i++) { + char *dot; +- size_t kplen; ++ size_t max_name_len; + + kp = &__start___param[i]; +- kplen = strlen(kp->name); ++ max_name_len = ++ min_t(size_t, MAX_KBUILD_MODNAME, strlen(kp->name)); + +- /* We do not handle args without periods. */ +- if (kplen > MAX_KBUILD_MODNAME) { +- DEBUGP("kernel parameter name is too long: %s\n", kp->name); +- continue; +- } +- dot = memchr(kp->name, '.', kplen); ++ dot = memchr(kp->name, '.', max_name_len); + if (!dot) { +- DEBUGP("couldn't find period in %s\n", kp->name); ++ DEBUGP("couldn't find period in first %d characters " ++ "of %s\n", MAX_KBUILD_MODNAME, kp->name); + continue; + } + name_len = dot - kp->name; diff --git a/queue-2.6.22/series b/queue-2.6.22/series index 292f9e8a061..31478dd94ff 100644 --- a/queue-2.6.22/series +++ b/queue-2.6.22/series @@ -5,3 +5,4 @@ alsa-hdsp-fix-zero-division.patch alsa-hda-codec-add-array-terminator-for-dmic-in-stac-codec.patch forcedeth-msi-bugfix.patch hptiop-avoid-buffer-overflow-when-returning-sense-data.patch +fix-param_sysfs_builtin-name-length-check.patch