summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-13 16:20:30 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-13 16:20:30 +0000
commit7302714e48b30ae6d1aac4a3f581de12fe5cb722 (patch)
treeefd1789c5e8088a6bf54401f54822a851ddf036a
parentd3a0cce466407e2b03e3066acfdebddc1aa9b465 (diff)
util/nvmutil: check gbe file type before write
Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r--util/nvmutil/nvmutil.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index c6e25ce7..1a3ee366 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -1377,6 +1377,9 @@ write_gbe_file(void)
if (gbe_st.st_size != gbe_file_size)
err(errno, "%s: file size changed before write", fname);
+ if (!S_ISREG(gbe_st.st_mode))
+ err(errno, "%s: file type changed before write", fname);
+
for (p = 0; p < 2; p++) {
partnum = p ^ command[cmd_index].invert;