Opened 11 years ago

Last modified 8 years ago

#9163 new bug

KDL when trying to read from outside of the 48-bit area of ​​the ahci disk.

Reported by: 3dEyes Owned by: marcusoverhagen
Priority: normal Milestone: R1
Component: Drivers/Disk Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

To reproduce the bug has written a simple program. If you do a test for the ata disk, read and seek work correctly. If repeated for ahci disk we get the following problems:

  1. read() always reads 1 byte, even outside of the disc size.
  2. if try to read a byte beyond the 48-bit area we get KDL.

Attachments (4)

ahci_disk.png (49.1 KB ) - added by 3dEyes 11 years ago.
Test for ahci disk
ata_disk.png (48.6 KB ) - added by 3dEyes 11 years ago.
Test for ata disk
Archive.zip (4.2 KB ) - added by 3dEyes 11 years ago.
Simple test with sources
badblock_kdl.png (26.6 KB ) - added by diger 11 years ago.

Download all attachments as: .zip

Change History (8)

by 3dEyes, 11 years ago

Attachment: ahci_disk.png added

Test for ahci disk

by 3dEyes, 11 years ago

Attachment: ata_disk.png added

Test for ata disk

by 3dEyes, 11 years ago

Attachment: Archive.zip added

Simple test with sources

comment:1 by 3dEyes, 11 years ago

I think problem is here -http://cgit.haiku-os.org/haiku/tree/src/add-ons/kernel/drivers/disk/scsi/scsi_disk/scsi_disk.cpp#n263

The number of read bytes is always returned as it was requested (regardless of status)

comment:2 by diver, 11 years ago

Still with us in hrev45363.

by diger, 11 years ago

Attachment: badblock_kdl.png added

comment:3 by diger, 11 years ago

Still with us in hrev45805.

I used "badblocks" from e2fsprogs & "testdisk" from TestDisk

comment:4 by kallisti5, 8 years ago

I noticed today while looking at AHCI port code that there are a few panics in the AHCI code. It seemed odd to me to be triggering KDL panics in the AHCI code. Is this really intended?

http://cgit.haiku-os.org/haiku/tree/src/add-ons/kernel/busses/scsi/ahci/ahci_port.cpp#n914

Note: See TracTickets for help on using tickets.