From 5287a80a7efa5246e75c926f66482e149d7af0dd Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 13 Mar 2026 17:52:23 +0000 Subject: util/nvmutil: check overflow in io_args Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index f586e199..e5a21afc 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -1761,6 +1761,9 @@ io_args(int fd, void *mem, size_t nrw, if (off < 0 || off >= gbe_file_size) goto err_io_args; + if ((off_t)(off + nrw) > gbe_file_size) + goto err_io_args; + if (nrw > GBE_PART_SIZE) goto err_io_args; -- cgit v1.2.1