提交 1bcaba51 编写于 作者: J Jan Beulich 提交者: Konrad Rzeszutek Wilk

xen/xenbus: fix overflow check in xenbus_file_write()

Acked-by: NIan Campbell <ian.campbell@citrix.com>
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NJan Beulich <jbeulich@suse.com>
[v1: Rebased on upstream]
Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
上级 2ebb939a
......@@ -458,7 +458,7 @@ static ssize_t xenbus_file_write(struct file *filp,
goto out;
/* Can't write a xenbus message larger we can buffer */
if ((len + u->len) > sizeof(u->u.buffer)) {
if (len > sizeof(u->u.buffer) - u->len) {
/* On error, dump existing buffer */
u->len = 0;
rc = -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册