diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-13 15:20:00 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-26 06:59:41 +0000 |
| commit | 83f67bf02aabf11c51194405b51b56e14148b247 (patch) | |
| tree | 15fdc66150ed68e34e71bc1ace2cb53b9846e188 /util/nvmutil | |
| parent | 14ab4c1b25df305e4b23dddbcff6e98361e32474 (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.c | 4 |
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) |
