mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-28 20:02:17 +00:00
xen/xenbus: fix overflow check in xenbus_file_write()
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>
This commit is contained in:
parent
2ebb939ab9
commit
1bcaba51eb
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue