From bb9010fdc144edd98963efcdf876cd87e61eeb98 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 10 Mar 2026 01:02:45 +0000 Subject: util/nvmutil: require good checksum on cat since the cat command can be used to create bad gbe files, if the checksums don't match. my rule is that nvmutil must never be used to destroy data, only correct it (e.g. a file with just one valid part can have it copied to the other part, but you can't copy a bad part - and i removed the "brick" command). i *did* disable checksum requirements on the dump command. with this, you can check the nvm area and it tells you what the correct checksum could be. then you could just correct it in a hex editor if you wanted to, quite easily. the idea is to slow down the act of destroying or corrupting data as much as possible. someone wily enough can use a hex editor to patch up some files just fine. Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index f2c0d5d7..91a1f8f9 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -322,19 +322,19 @@ static const struct commands command[] = { { CMD_CAT, "cat", cmd_helper_cat, ARGC_3, NO_INVERT, SET_MOD_OFF, ARG_NOPART, - SKIP_CHECKSUM_READ, SKIP_CHECKSUM_WRITE, + CHECKSUM_READ, SKIP_CHECKSUM_WRITE, GBE_PART_SIZE }, { CMD_CAT16, "cat16", cmd_helper_cat, ARGC_3, NO_INVERT, SET_MOD_OFF, ARG_NOPART, - SKIP_CHECKSUM_READ, SKIP_CHECKSUM_WRITE, + CHECKSUM_READ, SKIP_CHECKSUM_WRITE, GBE_PART_SIZE }, { CMD_CAT128, "cat128", cmd_helper_cat, ARGC_3, NO_INVERT, SET_MOD_OFF, ARG_NOPART, - SKIP_CHECKSUM_READ, SKIP_CHECKSUM_WRITE, + CHECKSUM_READ, SKIP_CHECKSUM_WRITE, GBE_PART_SIZE }, }; -- cgit v1.2.1