* [nfs-utils PATCH] blkmapd: reject zero-length signature components while decoding block signatures
@ 2026-09-03 17:54 Scott Mayhew
0 siblings, 0 replies; only message in thread
From: Scott Mayhew @ 2026-09-03 17:54 UTC (permalink / raw)
To: steved; +Cc: linux-nfs
A zero-length signature can cause blkmapd to map to an unintended
device.
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
---
utils/blkmapd/device-process.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/utils/blkmapd/device-process.c b/utils/blkmapd/device-process.c
index f53a6165..a47cc36e 100644
--- a/utils/blkmapd/device-process.c
+++ b/utils/blkmapd/device-process.c
@@ -81,6 +81,10 @@ static int decode_blk_signature(uint32_t **pp, uint32_t * end,
BLK_READBUF(p, end, 12);
READ64(comp->bs_offset);
READ32(siglen);
+ if (siglen == 0) {
+ BL_LOG_ERR("0 length signature component\n");
+ goto out_err;
+ }
comp->bs_length = siglen;
BLK_READBUF(p, end, siglen);
/* Note we rely here on fact that sig is used immediately
--
2.55.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-03 17:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-03 17:54 [nfs-utils PATCH] blkmapd: reject zero-length signature components while decoding block signatures Scott Mayhew
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox