1
0
Fork 0
alistair23-linux/drivers/infiniband/ulp
Sagi Grimberg 0f632bc483 IB/isert: Fix unaligned immediate-data handling
[ Upstream commit 0b089c1ef7 ]

Currently we allocate rx buffers in a single contiguous buffers for
headers (iser and iscsi) and data trailer. This means that most likely the
data starting offset is aligned to 76 bytes (size of both headers).

This worked fine for years, but at some point this broke, resulting in
data corruptions in isert when a command comes with immediate data and the
underlying backend device assumes 512 bytes buffer alignment.

We assume a hard-requirement for all direct I/O buffers to be 512 bytes
aligned. To fix this, we should avoid passing unaligned buffers for I/O.

Instead, we allocate our recv buffers with some extra space such that we
can have the data portion align to 512 byte boundary. This also means that
we cannot reference headers or data using structure but rather
accessors (as they may move based on alignment). Also, get rid of the
wrong __packed annotation from iser_rx_desc as this has only harmful
effects (not aligned to anything).

This affects the rx descriptors for iscsi login and data plane.

Fixes: 3d75ca0ade ("block: introduce multi-page bvec helpers")
Link: https://lore.kernel.org/r/20200904195039.31687-1-sagi@grimberg.me
Reported-by: Stephen Rust <srust@blockbridge.com>
Tested-by: Doug Dumitru <doug@dumitru.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-09-17 13:47:44 +02:00
..
ipoib RDMA/ipoib: Fix ABBA deadlock with ipoib_reap_ah() 2020-08-21 13:05:30 +02:00
iser IB/iser: bound protection_sg size by data_sg size 2019-12-31 16:43:15 +01:00
isert IB/isert: Fix unaligned immediate-data handling 2020-09-17 13:47:44 +02:00
opa_vnic treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
srp IB/srp: Never use immediate data if it is disabled by a user 2020-02-14 16:34:07 -05:00
srpt RDMA/srpt: Report the SCSI residual to the initiator 2020-01-17 19:48:40 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00