]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
s390/dasd: enforce dma_alignment to ensure proper buffer validation
authorJaehoon Kim <jhkim@linux.ibm.com>
Thu, 25 Sep 2025 15:47:08 +0000 (17:47 +0200)
committerJens Axboe <axboe@kernel.dk>
Thu, 25 Sep 2025 16:34:30 +0000 (10:34 -0600)
commit130e6de62107116eba124647116276266be0f84c
treea338ae5133febf98d5a3af1231f0296e5d67b101
parent8f4ed0ce4857ceb444174503fc9058720d4faaa1
s390/dasd: enforce dma_alignment to ensure proper buffer validation

The block layer validates buffer alignment using the device's
dma_alignment value. If dma_alignment is smaller than
logical_block_size(bp_block) -1, misaligned buffer incorrectly pass
validation and propagate to the lower-level driver.

This patch adjusts dma_alignment to be at least logical_block_size -1,
ensuring that misalignment buffers are properly rejected at the block
layer and do not reach the DASD driver unnecessarily.

Fixes: 2a07bb64d801 ("s390/dasd: Remove DMA alignment")
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Cc: stable@vger.kernel.org #6.11+
Signed-off-by: Jaehoon Kim <jhkim@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/s390/block/dasd.c