ata_id command provides wrong information for ATA devices
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd (Ubuntu) |
Fix Released
|
Medium
|
Ioanna Alifieraki | ||
Bionic |
Confirmed
|
Medium
|
Ioanna Alifieraki |
Bug Description
[DESCRIPTION]
Original revisions of the SAT (SCSI-ATA Translation) specification
required that all sense data be reported in Descriptor Format (72h).
Later revisions specifcally allow and account for sense data being
reported in Fixed Format (70h).
The current code checks for a Descriptor Format sense structure (0x72),
then looks specifically at the first byte of the first descriptor for the
ATA specific code 0x9, cross referencing it with the first byte which is
just a length field 0x0c (as a sanity check).
The code did not account for the Fixed Format case (0x70).
Upstream commit 402fecff19d42(
fixed this by checking for the Fixed Format case(0x70) adn then falling back to
using the top-level SCSI Sense data for the Additional Sense code (0x0) and
then the Additional Sense Code Qualifier (0x1d).
[TEST CASE]
To test this you need and ATA device.
Without the patch id_ata command returns error code 2.
With the patch it returns the correct information :
root@machine:~# ./ata_id /dev/sdn -x
ID_ATA=1
ID_TYPE=disk
ID_BUS=ata
ID_MODEL=
ID_MODEL_
ID_REVISION=
ID_SERIAL=
ID_SERIAL_
...
(see commit message for more details)
[REGRESSION POTENTIAL]
This commit changes disk_identify_
and therefore any regression potential will affect only this executable (and any other
that may use it).
[OTHER]
The fix is already in Focal.
Currently only Bionic is affected.
Upstream fix :
https:/
Changed in systemd (Ubuntu): | |
importance: | Undecided → Medium |
assignee: | nobody → Ioanna Alifieraki (joalif) |
Changed in systemd (Ubuntu Bionic): | |
status: | New → Confirmed |
tags: | added: sts |
Debdiff for bionic.