Commit 1bcaba51eba549748917f7d6eb41900ff9ee3d5f
Committed by
Konrad Rzeszutek Wilk
1 parent
2ebb939ab9
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
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>
Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff
drivers/xen/xenbus/xenbus_dev_frontend.c
... | ... | @@ -458,7 +458,7 @@ |
458 | 458 | goto out; |
459 | 459 | |
460 | 460 | /* Can't write a xenbus message larger we can buffer */ |
461 | - if ((len + u->len) > sizeof(u->u.buffer)) { | |
461 | + if (len > sizeof(u->u.buffer) - u->len) { | |
462 | 462 | /* On error, dump existing buffer */ |
463 | 463 | u->len = 0; |
464 | 464 | rc = -EINVAL; |