Commit b458805c authored by Sagi Grimberg's avatar Sagi Grimberg Committed by Luis Henriques

IB/iser: Fix wrong calculation of protection buffer length

commit a065fe6a upstream.

This length miss-calculation may cause a silent data corruption
in the DIX case and cause the device to reference unmapped area.

Fixes: d77e6535 ('libiscsi, iser: Adjust data_length to include protection information')
Signed-off-by: default avatarSagi Grimberg <sagig@mellanox.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 9bae3dbf
...@@ -402,8 +402,8 @@ int iser_send_command(struct iscsi_conn *conn, ...@@ -402,8 +402,8 @@ int iser_send_command(struct iscsi_conn *conn,
if (scsi_prot_sg_count(sc)) { if (scsi_prot_sg_count(sc)) {
prot_buf->buf = scsi_prot_sglist(sc); prot_buf->buf = scsi_prot_sglist(sc);
prot_buf->size = scsi_prot_sg_count(sc); prot_buf->size = scsi_prot_sg_count(sc);
prot_buf->data_len = data_buf->data_len >> prot_buf->data_len = (data_buf->data_len >>
ilog2(sc->device->sector_size) * 8; ilog2(sc->device->sector_size)) * 8;
} }
if (hdr->flags & ISCSI_FLAG_CMD_READ) { if (hdr->flags & ISCSI_FLAG_CMD_READ) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment