util/nvmutil: block bad offset in io_args

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-13 15:20:00 +00:00
parent 969e98c78d
commit 995f25e199

View File

@@ -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)