block: bio-integrity: Copy flags when bio_integrity_payload is cloned
PATCH 1/1 block: bio-integrity: Copy flags when bio_integrity_payload is cloned
Make sure to copy the flags when a bio_integrity_payload is cloned. Otherwise per-I/O properties such as IP checksum flag will not be passed down to the HBA driver. Since the integrity buffer is owned by the original bio, the BIP_BLOCK_INTEGRITY flag needs to be masked off to avoid a double free in the completion path.
--- block/bio-integrity.c | 1 + 1 file changed, 1 insertion(+)
block/bio-integrity.c +1 -0
@@ -418,6 +418,7 @@ int bio_integrity_clone(struct bio *bio, struct bio *bio_src, bip->bip_vcnt = bip_src->bip_vcnt; bip->bip_iter = bip_src->bip_iter; + bip->bip_flags = bip_src->bip_flags & ~BIP_BLOCK_INTEGRITY ;return 0 ; }
Signature · 1 line
2.36.1
Quoted 6 lines · Martin K. Petersen
Make sure to copy the flags when a
bio_integrity_payloadis cloned. Otherwise per-I/O properties such as IP checksum flag will not be passed down to the HBA driver. Since the integrity buffer is owned by the original bio, theBIP_BLOCK_INTEGRITYflag needs to be masked off to avoid a double free in the completion path.
Quoted 6 lines
Fixes aae7df50190a ("block: Integrity checksum flag")Fixes b1f01388574c ("block: Relocate bio integrity flags")Reported-by Saurav Kashyap <[email protected]>Tested-by Saurav Kashyap <[email protected]>Signed-off-by Martin K. Petersen <[email protected]>---
Looks good.
-ck
Quoted 5 lines · Martin K. Petersen
Make sure to copy the flags when a
bio_integrity_payloadis cloned. Otherwise per-I/O properties such as IP checksum flag will not be passed down to the HBA driver. Since the integrity buffer is owned by the original bio, theBIP_BLOCK_INTEGRITYflag needs to be masked off to avoid a double free in the completion path.
Looks good:
Quoted 8 lines · Martin K. Petersen
Make sure to copy the flags when a
bio_integrity_payloadis cloned. Otherwise per-I/O properties such as IP checksum flag will not be passed down to the HBA driver. Since the integrity buffer is owned by the original bio, theBIP_BLOCK_INTEGRITYflag needs to be masked off to avoid a double free in the completion path.[...]
Applied, thanks!
[1/1] block: bio-integrity: Copy flags when bio_integrity_payload is cloned
commit: b6a4bdcda430e3ca43bbb9cb1d4d4d34ebe15c40
Best regards,
Signature · 1 line
Jens Axboe