提交 94cbc203 编写于 作者: S Sebastian Ott 提交者: Martin Schwidefsky

[S390] cio: fix wrong buffer access in cio_ignore_write

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: NSebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 e909074b
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册