mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
ubi: Fix out of bounds write in volume update code
ubi_start_leb_change() allocates too few bytes. ubi_more_leb_change_data() will write up to req->upd_bytes + ubi->min_io_size bytes. Cc: [email protected] Signed-off-by: Richard Weinberger <[email protected]> Reviewed-by: Boris Brezillon <[email protected]>
This commit is contained in:
parent
fc77dbd34c
commit
e4f6daac20
1 changed files with 1 additions and 1 deletions
|
|
@ -193,7 +193,7 @@ int ubi_start_leb_change(struct ubi_device *ubi, struct ubi_volume *vol,
|
|||
vol->changing_leb = 1;
|
||||
vol->ch_lnum = req->lnum;
|
||||
|
||||
vol->upd_buf = vmalloc(req->bytes);
|
||||
vol->upd_buf = vmalloc(ALIGN((int)req->bytes, ubi->min_io_size));
|
||||
if (!vol->upd_buf)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue