Skip to content

Commit

Permalink
xen/xenbus: fix overflow check in xenbus_file_write()
Browse files Browse the repository at this point in the history
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
[v1: Rebased on upstream]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  • Loading branch information
Jan Beulich authored and Konrad Rzeszutek Wilk committed Oct 30, 2012
1 parent 2ebb939 commit 1bcaba5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/xen/xenbus/xenbus_dev_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1bcaba5

Please sign in to comment.