From 7302714e48b30ae6d1aac4a3f581de12fe5cb722 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 13 Mar 2026 16:20:30 +0000 Subject: util/nvmutil: check gbe file type before write Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'util/nvmutil') 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; -- cgit v1.2.1