]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
block: bio-integrity: Copy flags when bio_integrity_payload is cloned
authorMartin K. Petersen <martin.petersen@oracle.com>
Wed, 15 Feb 2023 17:18:01 +0000 (12:18 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 15:26:35 +0000 (16:26 +0100)
commitaf1881903e7207f58ae5085442e2fb9b7e59780a
treef0e94701db7fb6ffdec8aaadad277c69ce0cfb62
parent5c43cde09313ddf43273a07f0a57caba49c51345
block: bio-integrity: Copy flags when bio_integrity_payload is cloned

[ Upstream commit b6a4bdcda430e3ca43bbb9cb1d4d4d34ebe15c40 ]

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.

Fixes: aae7df50190a ("block: Integrity checksum flag")
Fixes: b1f01388574c ("block: Relocate bio integrity flags")
Reported-by: Saurav Kashyap <skashyap@marvell.com>
Tested-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Link: https://lore.kernel.org/r/20230215171801.21062-1-martin.petersen@oracle.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
block/bio-integrity.c