blkmapd: reject zero-length signature components while decoding block signatures
Subsystems (2)
PATCH 1/1 blkmapd: reject zero-length signature components while decoding block signatures
A zero-length signature can cause blkmapd to map to an unintended device.
Signed-off-by Scott Mayhew <[email protected]>
--- utils/blkmapd/device-process.c | 4 ++++ 1 file changed, 4 insertions(+)
utils/blkmapd/device-process.c +4 -0
@@ -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
Signature · 1 line
2.55.0
Quoted 4 lines · Scott Mayhew
A zero-length signature can cause blkmapd to map to an unintended device.
Signed-off-by Scott Mayhew <[email protected]>
Committed... (tag: nfs-utils-2-9-3-rc4)
steved.> ---
Quoted 18 lines
utils/blkmapd/device-process.c | 4 ++++ 1 file changed, 4 insertions(+)utils/blkmapd/device-process.c +4
-0@@ -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