[PR #851] [MERGED] Make Kreon SCSI CDB10 for libata #1168

Closed
opened 2026-01-29 15:43:03 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/aaru-dps/Aaru/pull/851
Author: @Deterous
Created: 8/16/2024
Status: Merged
Merged: 10/20/2024
Merged by: @claunia

Base: develHead: devel


📝 Commits (1)

  • e8a57e4 Make Kreon SCSI CDB10 for libata

📊 Changes

1 file changed (+3 additions, -3 deletions)

View changed files

📝 Aaru.Devices/Device/ScsiCommands/Kreon.cs (+3 -3)

📄 Description

Simple bug fix
Fixes #850

Summary

This change turns the Kreon commands in Aaru into CDB10, which fixes dumping with SATA connections (libata) on Linux. It may fix MacOS dumps as well, however Mac has never been tested to be working or not working Windows doesn't do minimum CDB command size checks, hence why Windows dumps worked in the past, and this change does not break Windows dumps.

Details

Kreon SCSI commands (vendor specific 0xFF) are currently CDB6 (6-long CDB command) in Aaru.
Linux's libata expects a minimum of 10-long CDB command: https://github.com/torvalds/linux/blob/master/drivers/ata/libata-scsi.c#L4199
As a result, Aaru sends the Kreon lock state command, which returns sense data that looks like no error has occurred, so the dump continues. However, libata never sent the command to the driver, so the drive does not lock/unlock, and the wrong sectors are dumped.

Testing

This PR follows work done by @tbejos to support Kreon dumping in redumper.
While it hasn't been tested in aaru, DIC and Redumper have both had this minor change and have been tested in Linux and Windows, so it follows that this change is required for Aaru too.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • New filesystem, test images in [url]
  • New media image, test images in [url]
  • New partition scheme, test images in [url]
  • Breaking change (fix or feature that would cause existing functionality to change)
  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/aaru-dps/Aaru/pull/851 **Author:** [@Deterous](https://github.com/Deterous) **Created:** 8/16/2024 **Status:** ✅ Merged **Merged:** 10/20/2024 **Merged by:** [@claunia](https://github.com/claunia) **Base:** `devel` ← **Head:** `devel` --- ### 📝 Commits (1) - [`e8a57e4`](https://github.com/aaru-dps/Aaru/commit/e8a57e40677d02e1b4463b571b8173dbaa08fe86) Make Kreon SCSI CDB10 for libata ### 📊 Changes **1 file changed** (+3 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `Aaru.Devices/Device/ScsiCommands/Kreon.cs` (+3 -3) </details> ### 📄 Description Simple bug fix Fixes #850 ### Summary This change turns the Kreon commands in Aaru into CDB10, which fixes dumping with SATA connections (`libata`) on Linux. It may fix MacOS dumps as well, however Mac has never been tested to be working or not working Windows doesn't do minimum CDB command size checks, hence why Windows dumps worked in the past, and this change does not break Windows dumps. ### Details Kreon SCSI commands (vendor specific `0xFF`) are currently CDB6 (6-long CDB command) in Aaru. Linux's `libata` expects a minimum of 10-long CDB command: https://github.com/torvalds/linux/blob/master/drivers/ata/libata-scsi.c#L4199 As a result, Aaru sends the Kreon lock state command, which returns sense data that looks like no error has occurred, so the dump continues. However, `libata` never sent the command to the driver, so the drive does not lock/unlock, and the wrong sectors are dumped. ### Testing This PR follows work done by @tbejos to support Kreon dumping in redumper. While it hasn't been tested in aaru, DIC and Redumper have both had this minor change and have been tested in Linux and Windows, so it follows that this change is required for Aaru too. ## Types of changes <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] New filesystem, test images in [url] - [ ] New media image, test images in [url] - [ ] New partition scheme, test images in [url] - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [x] I have read the **CONTRIBUTING** document. - [x] My code follows the code style of this project. - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. - [ ] I have added tests to cover my changes. - [ ] All new and existing tests passed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 15:43:03 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: aaru-dps/Aaru-aaru-dps#1168