Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix length calculation in scsi_command_util::ModeSelect #1447

Closed
wants to merge 2 commits into from

Commits on Apr 1, 2024

  1. Fix length calculation in scsi_command_util::ModeSelect

    OpenVMS Alpha sends a strange ModeSelect payload, apparently one byte
    too large. This was 'fixed' by a (wrong) length calculation in PiSCSI#1405, breaking PiSCSI#1427.
    
    This PR
    - fixes the wrong length calculation
    - improves the loop test in scsi_command_util::ModeSelect to prevent a
      buffer overflow. (Remaining length was checked for > 0, but buffer
      access is at offset and offset + 1, effectively requiring 2 bytes.)
    - the loop test fix makes PiSCSI#1402 pass
    - adds a testcase for PiSCSI#1402
    - adds a testcase for PiSCSI#1427
    
    Fixes issue PiSCSI#1427
    
    Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>
    kkaempf committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    73917bc View commit details
    Browse the repository at this point in the history

Commits on Apr 2, 2024

  1. Improve buffer overflow checking in scsi_command_util::ModeSelect

    Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>
    kkaempf committed Apr 2, 2024
    Configuration menu
    Copy the full SHA
    73080d3 View commit details
    Browse the repository at this point in the history