lkml.org 
[lkml]   [2012]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 1/3] tcm_iscsi: warn on incorrect precondition for iscsit_do_crypto_hash_sg
Date
While iscsit_do_crypto_hash_sg does look at cmd->first_data_sg_off
when computing cur_len, it ignores it completely when computing the
hash. As a result, the first cmd->first_data_sg_off bytes are
included in the hash even though they should not. Warn if this
happens.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
drivers/target/iscsi/iscsi_target.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index 97c0f78..224679e 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -1135,6 +1135,7 @@ static u32 iscsit_do_crypto_hash_sg(

sg = cmd->first_data_sg;
page_off = cmd->first_data_sg_off;
+ WARN_ON(page_off != sg->offset);

i = 0;
while (data_length) {
--
1.7.1



\
 
 \ /
  Last update: 2012-09-05 18:03    [W:0.134 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site