diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2013-10-14 08:08:35 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2013-10-24 11:17:07 -0400 |
commit | 57f47ba0cb74303230a373d27238a0aaa0df3775 (patch) | |
tree | 92bea4736086a721aafd7d5d0fdcf31b5fc3ba97 /arch/s390/appldata/appldata_base.c | |
parent | 041058a16a71a1257a1c3c19a55d74641912b918 (diff) |
s390/appldata: make copy_from_user() invocations provably correct
Just change the type of "len" to unsigned int so the compiler can prove
that we don't have a buffer overflow (and generates less code).
We get rid of these:
In function 'copy_from_user',
inlined from 'appldata_interval_handler' at
arch/s390/appldata/appldata_base.c:265:
uaccess.h:303: warning: call to 'copy_from_user_overflow' declared
with attribute warning: copy_from_user() buffer size is not provably
correct
In function 'copy_from_user',
inlined from 'appldata_timer_handler' at
arch/s390/appldata/appldata_base.c:225:
uaccess.h:303: warning: call to 'copy_from_user_overflow' declared
with attribute warning: copy_from_user() buffer size is not provably
correct
In function 'copy_from_user',
inlined from 'appldata_generic_handler' at
arch/s390/appldata/appldata_base.c:333:
uaccess.h:303: warning: call to 'copy_from_user_overflow' declared
with attribute warning: copy_from_user() buffer size is not provably
correct
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/appldata/appldata_base.c')
-rw-r--r-- | arch/s390/appldata/appldata_base.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c index 87a22092b68f..603d2003cd9f 100644 --- a/arch/s390/appldata/appldata_base.c +++ b/arch/s390/appldata/appldata_base.c | |||
@@ -204,7 +204,7 @@ static int | |||
204 | appldata_timer_handler(ctl_table *ctl, int write, | 204 | appldata_timer_handler(ctl_table *ctl, int write, |
205 | void __user *buffer, size_t *lenp, loff_t *ppos) | 205 | void __user *buffer, size_t *lenp, loff_t *ppos) |
206 | { | 206 | { |
207 | int len; | 207 | unsigned int len; |
208 | char buf[2]; | 208 | char buf[2]; |
209 | 209 | ||
210 | if (!*lenp || *ppos) { | 210 | if (!*lenp || *ppos) { |
@@ -246,7 +246,8 @@ static int | |||
246 | appldata_interval_handler(ctl_table *ctl, int write, | 246 | appldata_interval_handler(ctl_table *ctl, int write, |
247 | void __user *buffer, size_t *lenp, loff_t *ppos) | 247 | void __user *buffer, size_t *lenp, loff_t *ppos) |
248 | { | 248 | { |
249 | int len, interval; | 249 | unsigned int len; |
250 | int interval; | ||
250 | char buf[16]; | 251 | char buf[16]; |
251 | 252 | ||
252 | if (!*lenp || *ppos) { | 253 | if (!*lenp || *ppos) { |
@@ -290,7 +291,8 @@ appldata_generic_handler(ctl_table *ctl, int write, | |||
290 | void __user *buffer, size_t *lenp, loff_t *ppos) | 291 | void __user *buffer, size_t *lenp, loff_t *ppos) |
291 | { | 292 | { |
292 | struct appldata_ops *ops = NULL, *tmp_ops; | 293 | struct appldata_ops *ops = NULL, *tmp_ops; |
293 | int rc, len, found; | 294 | unsigned int len; |
295 | int rc, found; | ||
294 | char buf[2]; | 296 | char buf[2]; |
295 | struct list_head *lh; | 297 | struct list_head *lh; |
296 | 298 | ||