Acidanthera UEFI Development Kit based on EDK II edk2-stable202311
Go to file
Laszlo Ersek c128d5281f MdePkg: UefiScsiLib: do not encode LUN in CDB for READ and WRITE
The "SCSI Block Commands - 2" (SBC-2) standard defines bits [7:5] of the
CDB byte 1 as Reserved, for the READ and WRITE commands.

The updated "SCSI Block Commands - 3" (SBC-3) standard defines the same
bitfield as RDPROTECT and WRPROTECT, respectively.

After reviewing the above standards, and the following commits:
- SVN r8331 (git 676e2a32),
- SVN r8334 (git 6b3ecf5c),
we've determined that UefiScsiLib is incorrect in encoding the LUN in this
bitfield for the READ and WRITE commands.

Encoding a nonzero LUN there creates unintended RDPROTECT and WRPROTECT
values, which the recipient device is required to reject if it does not
support protection information, with CHECK CONDITION, ILLEGAL REQUEST,
INVALID FIELD IN CDB:

  ScsiDiskRead10: Check Condition happened!
  ScsiDisk: Sense Key = 0x5 ASC = 0x24!
  ScsiDiskRead10: Check Condition happened!
  ScsiDisk: Sense Key = 0x5 ASC = 0x24!
  ScsiDiskRead10: Check Condition happened!
  ScsiDisk: Sense Key = 0x5 ASC = 0x24!
  ScsiDiskRead10: Check Condition happened!
  ScsiDisk: Sense Key = 0x5 ASC = 0x24!
  FatOpenDevice: read of part_lba failed Device Error

In practice this flaw breaks UefiScsiLib minimally on SCSI disks with
nonzero LUNs that are emulated by QEMU (after QEMU commit 96bdbbab, part
of v1.2.0).

RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1166971

Reported-by: Cole Robinson <crobinso@redhat.com>

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>

Suggested-by: Feng Tian <feng.tian@intel.com>

Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Laszlo Ersek <lersek@redhat.com>

Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16454 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-28 10:24:41 +00:00
AppPkg AppPkg: Disable Lua builds by default. Update the ReadMe file. 2014-11-11 23:15:32 +00:00
ArmPkg ArmPkg/ArmGicLib: select GICv2 mode if SRE is present but unavailable 2014-11-13 16:41:51 +00:00
ArmPlatformPkg ArmPlatformPkg: fix undefined reference to memcpy 2014-11-12 10:01:41 +00:00
BaseTools BaseTools/UPT: Fix an issue of storing wrong PCD into XML file. 2014-11-25 04:58:17 +00:00
BeagleBoardPkg ArmPlatformPkg: Increase more ARM address Pcd entries to 64-bit. 2014-11-11 00:43:03 +00:00
Conf EDK II: Add .gitignore 2014-10-14 16:08:15 +00:00
CryptoPkg CryptoPkg: OpenSslSupport.h: edk2-ize offsetof() macro for gcc-4.8 / X64 2014-11-14 10:24:33 +00:00
DuetPkg Change NT32 and DUET to use UEFI Shell by default. Use "-D USE_OLD_SHELL" for NT32 to use EDK Shell. 2014-11-25 08:53:33 +00:00
EdkCompatibilityPkg EdkCompatibilityPkg: Make this field name match the name in the spec. 2014-11-26 01:22:15 +00:00
EdkShellBinPkg EDK II Contributions.txt: Update patch format information 2014-10-31 22:05:50 +00:00
EdkShellPkg EDK II Contributions.txt: Update patch format information 2014-10-31 22:05:50 +00:00
EmbeddedPkg EmbeddedPkg/Lan9118Dxe: Remove link check in SNP initialization 2014-11-11 00:49:50 +00:00
EmulatorPkg EmulatorPkg/MpService: add enabled processor check for startupThisAP 2014-11-21 22:46:49 +00:00
FatBinPkg EDK II Contributions.txt: Update patch format information 2014-10-31 22:05:50 +00:00
IntelFrameworkModulePkg Try to read key strike even when the TimeOuts value is zero, this will avoid BDS not get user input when TimeOuts value set to zero. 2014-11-06 08:56:54 +00:00
IntelFrameworkPkg EDK II Contributions.txt: Update patch format information 2014-10-31 22:05:50 +00:00
IntelFspPkg Fix an issue on FixedMtreProgramming - AND/OR mask incorrect. 2014-09-28 01:07:13 +00:00
IntelFspWrapperPkg IntelFspPkg/IntelFspWrapperPkg: Fix some typos. 2014-09-03 06:48:38 +00:00
MdeModulePkg MdeModulePkg DxeCore: Check pointer AllocInfoData before dereferencing. 2014-11-27 02:51:04 +00:00
MdePkg MdePkg: UefiScsiLib: do not encode LUN in CDB for READ and WRITE 2014-11-28 10:24:41 +00:00
NetworkPkg Fix a bug in DHCP6 driver when using DUID LLT. 2014-11-12 05:14:07 +00:00
Nt32Pkg Change NT32 and DUET to use UEFI Shell by default. Use "-D USE_OLD_SHELL" for NT32 to use EDK Shell. 2014-11-25 08:53:33 +00:00
Omap35xxPkg EDK II Contributions.txt: Update patch format information 2014-10-31 22:05:50 +00:00
OptionRomPkg EDK II Contributions.txt: Update patch format information 2014-10-31 22:05:50 +00:00
OvmfPkg OvmfPkg: CsmSupportLib: depend on OvmfPkg.dec explicitly 2014-11-21 09:40:47 +00:00
PcAtChipsetPkg Initialize alarm register in PcRtc module entrypoint to make UEFI SCT GetWakeupTime pass. 2014-11-25 03:38:20 +00:00
PerformancePkg EDK II Contributions.txt: Update patch format information 2014-10-31 22:05:50 +00:00
SecurityPkg Correct the alignment calculation of PE/COFF attribute certificate entry. 2014-11-26 08:21:54 +00:00
ShellBinPkg EDK II Contributions.txt: Update patch format information 2014-10-31 22:05:50 +00:00
ShellPkg ShellPkg: Update Shell DH command to display more info. 2014-11-25 22:41:30 +00:00
SourceLevelDebugPkg Fix a bug in DebugAgent that hang happens when the ACK for GO is lost. 2014-11-10 08:47:49 +00:00
StdLib StdLib/AppPkg: Add the NOOPT build target and fix a type conversion problem with VS2005. 2014-11-11 22:56:58 +00:00
StdLibPrivateInternalFiles EDK II Contributions.txt: Update patch format information 2014-10-31 22:05:50 +00:00
UefiCpuPkg Add typecast to fix VS2005 build issue. 2014-11-24 04:57:40 +00:00
UnixPkg UnixPkg: Remove UnixPkg files (It is replaced by EmulatorPkg) 2013-07-29 21:09:55 +00:00
.gitignore EDK II: Add .gitignore 2014-10-14 16:08:15 +00:00
BuildNotes2.txt Update to new SVN URL in readme.txt 2013-06-08 05:26:39 +00:00
Edk2Setup.bat Updated version, missed the last two commits and to add the SVN Revision property (last part of the version value). 2014-08-22 16:08:47 +00:00
Maintainers.txt Update some package owners 2014-10-23 01:35:44 +00:00
edksetup.bat Update edksetup.bat to support Microsoft Visual Studio 2013 when building the Nt32Pkg emulation platform (enabled using the --nt32 flag). 2014-10-30 17:09:25 +00:00
edksetup.sh edksetup.sh: Ensure that WORKSPACE points to the top of an edk2 checkout 2014-07-28 17:37:40 +00:00