Skip to content

ide: fix drive head toctou bug on enlightened path (#3535)#4019

Open
babayet2 wants to merge 1 commit into
microsoft:release/1.7.2511from
babayet2:toctou-backport
Open

ide: fix drive head toctou bug on enlightened path (#3535)#4019
babayet2 wants to merge 1 commit into
microsoft:release/1.7.2511from
babayet2:toctou-backport

Conversation

@babayet2

Copy link
Copy Markdown
Collaborator

This is a clean cherry-pick of #3535

The enlightened path in the IDE implementation is supposed to check whether the drive is busy, and bail out if so.

We were checking if the drive is busy before switching the device head, meaning we could mistakenly go further down the enlightened path, even when the drive was busy. Fixed.

The enlightened path in the IDE implementation is supposed to check
whether the drive is busy, and bail out if so.

We were checking if the drive is busy before switching the
device head, meaning we could mistakenly go further down the enlightened
path, even when the drive was busy. Fixed.
@babayet2
babayet2 requested a review from a team as a code owner July 24, 2026 02:44
Copilot AI review requested due to automatic review settings July 24, 2026 02:44
@babayet2
babayet2 requested a review from a team as a code owner July 24, 2026 02:44
@github-actions github-actions Bot added the release_1.7.2511 Targets the release/1.7.2511 branch. label Jul 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a correctness issue in the IDE device’s “enlightened” I/O path by ensuring the drive-busy/error check is performed after selecting the target drive via the Device/Head register, preventing the command from proceeding based on the status of the previously-selected drive.

Changes:

  • Move the current_drive_status() busy/error guard to occur after the Device/Head register write, so the check applies to the intended drive.
  • Preserve the existing early-return behavior (ignore enlightened command) when the selected drive is in error (ERR) or has a pending command (BSY/DRQ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release_1.7.2511 Targets the release/1.7.2511 branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants