summaryrefslogtreecommitdiff
path: root/util/nvmutil
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-13 15:20:00 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-13 15:21:44 +0000
commit995f25e19927c7f2d2a89c8a5fb8985c3bb00f3a (patch)
tree780749eec4de17465aed9a34d0209e4106d3cae3 /util/nvmutil
parent969e98c78dc8daf0fc6f93e607362596c140ee83 (diff)
util/nvmutil: block bad offset in io_args
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil')
-rw-r--r--util/nvmutil/nvmutil.c4
1 files changed, 4 insertions, 0 deletions
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)