The patch titled
     Fix IPMI watchdog set_param_str() using kstrdup
has been added to the -mm tree.  Its filename is
     fix-ipmi-watchdog-set_param_str-using-kstrdup.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: Fix IPMI watchdog set_param_str() using kstrdup
From: Sebastien Dugué <[EMAIL PROTECTED]>

set_param_str() cannot use kstrdup() to duplicate the parameter.  That's
fine when the driver is compiled as a module but it sure is not when built
into the kernel as the kernel parameters are parsed before the kmalloc
slabs are setup.

Signed-off-by: Sebastien Dugué <[EMAIL PROTECTED]>
Cc: Corey Minyard <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/char/ipmi/ipmi_watchdog.c |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff -puN 
drivers/char/ipmi/ipmi_watchdog.c~fix-ipmi-watchdog-set_param_str-using-kstrdup 
drivers/char/ipmi/ipmi_watchdog.c
--- 
a/drivers/char/ipmi/ipmi_watchdog.c~fix-ipmi-watchdog-set_param_str-using-kstrdup
+++ a/drivers/char/ipmi/ipmi_watchdog.c
@@ -216,13 +216,13 @@ static int set_param_str(const char *val
 {
        action_fn  fn = (action_fn) kp->arg;
        int        rv = 0;
-       char       *dup, *s;
+       char       valcp[16];
+       char       *s;
 
-       dup = kstrdup(val, GFP_KERNEL);
-       if (!dup)
-               return -ENOMEM;
+       strncpy(valcp, val, 16);
+       valcp[15] = '\0';
 
-       s = strstrip(dup);
+       s = strstrip(valcp);
 
        down_read(&register_sem);
        rv = fn(s, NULL);
@@ -235,7 +235,6 @@ static int set_param_str(const char *val
 
  out_unlock:
        up_read(&register_sem);
-       kfree(dup);
        return rv;
 }
 
_

Patches currently in -mm which might be from [EMAIL PROTECTED] are

fix-ipmi-watchdog-set_param_str-using-kstrdup.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to