From 995f25e19927c7f2d2a89c8a5fb8985c3bb00f3a Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 13 Mar 2026 15:20:00 +0000 Subject: util/nvmutil: block bad offset in io_args Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'util/nvmutil') diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 266ba397..2aa47d19 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -1716,6 +1716,10 @@ static int io_args(int fd, void *mem, size_t nrw, off_t off, int rw_type) { + if (off > 0 + && off != GBE_PART_SIZE) + goto err_io_args; + if (nrw != GBE_PART_SIZE && nrw != NVM_SIZE && nrw != NUM_RANDOM_BYTES) -- cgit v1.2.1