Commit 1bcaba51 authored by Jan Beulich's avatar Jan Beulich Committed by Konrad Rzeszutek Wilk

xen/xenbus: fix overflow check in xenbus_file_write()

Acked-by: default avatarIan Campbell <ian.campbell@citrix.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarJan Beulich <jbeulich@suse.com>
[v1: Rebased on upstream]
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment