aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-04-09 07:42:59 -0400
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>2010-04-09 07:43:02 -0400
commit35ac734f72d846f250c0344913a91f954ea764c3 (patch)
tree6f86aeb8ecb387afce50eb36e9001a234479a586 /drivers/s390
parentd7015c120e0ac55d86cabbe7a14997b99f39e282 (diff)
[S390] sclp_async: potential buffer overflow
"len" hasn't been properly range checked so we shouldn't use it as an array offset. This can only be written to by root but it would still be annoying to accidentally write more than 3 characters and corrupt your memory. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/char/sclp_async.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/s390/char/sclp_async.c b/drivers/s390/char/sclp_async.c
index 2aecf7f21361..7ad30e72f868 100644
--- a/drivers/s390/char/sclp_async.c
+++ b/drivers/s390/char/sclp_async.c
@@ -85,7 +85,7 @@ static int proc_handler_callhome(struct ctl_table *ctl, int write,
85 rc = copy_from_user(buf, buffer, sizeof(buf)); 85 rc = copy_from_user(buf, buffer, sizeof(buf));
86 if (rc != 0) 86 if (rc != 0)
87 return -EFAULT; 87 return -EFAULT;
88 buf[len - 1] = '\0'; 88 buf[sizeof(buf) - 1] = '\0';
89 if (strict_strtoul(buf, 0, &val) != 0) 89 if (strict_strtoul(buf, 0, &val) != 0)
90 return -EINVAL; 90 return -EINVAL;
91 if (val != 0 && val != 1) 91 if (val != 0 && val != 1)