Skip to content

Commit

Permalink
[S390] cio: fix wrong buffer access in cio_ignore_write
Browse files Browse the repository at this point in the history
Writing only spaces to /proc/cio_ignore will cause a buffer overflow
since the size_t value i will not become negative and so buf[-1UL] is
accessed. Change the value of i to ssize_t.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Sebastian Ott authored and Martin Schwidefsky committed Mar 26, 2009
1 parent e909074 commit 94cbc20
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/s390/cio/blacklist.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,7 @@ cio_ignore_write(struct file *file, const char __user *user_buf,
size_t user_len, loff_t *offset)
{
char *buf;
size_t i;
ssize_t rc, ret;
ssize_t rc, ret, i;

if (*offset)
return -EINVAL;
Expand Down

0 comments on commit 94cbc20

Please sign in to comment.