Skip to content

Commit

Permalink
target: Re-add explict zeroing of INQUIRY bounce buffer memory
Browse files Browse the repository at this point in the history
This patch fixes a regression in spc_emulate_inquiry() code where the
local scope bounce buffer was no longer getting it's memory zeroed,
causing various problems with SCSI initiators that depend upon areas
of INQUIRY EVPD=0x83 payload having been zeroed.

This bug was introduced with the following v3.7-rc1 patch + CC'ed
stable commit:

commit ffe7b0e
Author: Paolo Bonzini <[email protected]>
Date:   Fri Sep 7 17:30:38 2012 +0200

    target: support zero allocation length in INQUIRY

Go ahead and re-add the missing memset of bounce buffer memory to be
copied into the outgoing se_cmd descriptor kmapped SGL payload.

Reported-by: Kelsey Prantis <[email protected]>
Cc: Kelsey Prantis <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Andy Grover <[email protected]>
Cc: [email protected]
Signed-off-by: Nicholas Bellinger <[email protected]>
  • Loading branch information
Nicholas Bellinger committed Nov 1, 2012
1 parent 1a1ff38 commit dea5f09
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/target/target_core_spc.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,8 @@ static int spc_emulate_inquiry(struct se_cmd *cmd)
unsigned char buf[SE_INQUIRY_BUF];
int p, ret;

memset(buf, 0, SE_INQUIRY_BUF);

if (dev == tpg->tpg_virt_lun0.lun_se_dev)
buf[0] = 0x3f; /* Not connected */
else
Expand Down

0 comments on commit dea5f09

Please sign in to comment.