diff options
author | Sagi Grimberg <sagi@grimberg.me> | 2020-09-04 12:50:39 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-12-13 17:42:20 +0100 |
commit | 2e0dfb566559da99fa5e81bc1caafe45952abff8 (patch) | |
tree | dcf55787c120ae17f548da13b5fbd8cb4b663773 /drivers/base/devcoredump.c | |
parent | 5cff0311825c90e4ead805f338cd754c72e07fa0 (diff) | |
download | linux-stable-2e0dfb566559da99fa5e81bc1caafe45952abff8.tar.gz linux-stable-2e0dfb566559da99fa5e81bc1caafe45952abff8.tar.bz2 linux-stable-2e0dfb566559da99fa5e81bc1caafe45952abff8.zip |
IB/isert: Fix unaligned immediate-data handling
commit 0b089c1ef7047652b13b4cdfdb1e0e7dbdb8c9ab upstream.
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: 3d75ca0adef4 ("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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/devcoredump.c')
0 files changed, 0 insertions, 0 deletions