Skip to content

Updated MODE SENSE error handling in case of an overflow#732

Merged
akuker merged 2 commits intodevelopfrom
fix_mode_sense
Mar 14, 2022
Merged

Updated MODE SENSE error handling in case of an overflow#732
akuker merged 2 commits intodevelopfrom
fix_mode_sense

Conversation

@uweseimet
Copy link
Copy Markdown
Contributor

@uweseimet uweseimet commented Mar 11, 2022

This change updates the error handling The SCSI-2 specification says:

If the mode parameter list exceeds 256 bytes for a MODE SENSE(6) command or 65536 bytes for a MODE SENSE(10) command, the target shall return CHECK CONDITION status and the sense key shall be set to ILLEGAL REQUEST and the additional sense code set to INVALID FIELD IN CDB.

Elsewhere the specification says that the number of returned bytes can never be more than ALLOCATION_LENGTH, because that is the amount of memory the initiator has reserved. Effectively this means that the limit is not 256 or 65536, resp., but 255 or 65535. This PR checks against the latter.

@uweseimet uweseimet requested a review from rdmark March 11, 2022 09:25
@akuker akuker merged commit 32fb022 into develop Mar 14, 2022
@akuker akuker deleted the fix_mode_sense branch March 14, 2022 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants