Skip to content

Bug: False “Setup Mode not enabled” on Dell firmware #28

@majidmazin

Description

@majidmazin

Bug: False “Setup Mode not enabled” on Dell firmware

Summary

Mosby reports:
on a Dell OptiPlex 7060 system, even though the firmware is verifiably in Setup Mode.


Environment

  • Platform: Dell OptiPlex 7060 MT
  • Firmware: Dell Inc. 1.32.0
  • CPU: i9-9900
  • Secure Boot: Disabled
  • Custom Key Management: Enabled
  • Keys: All keys deleted (PK, KEK, db, dbx)

Verification

From UEFI Shell:


Variable RT+BS 'EFIGlobalVariable:SetupMode' DataSize = 0x01
00000000: 01

This indicates the system is in Setup Mode (SetupMode = 1).

⸻

Observed Behavior

Despite the above, Mosby exits early with:

```ERROR: Setup Mode not enabled (Attempt #1)

Analysis

From Ghidra, Mosby reads SetupMode into a buffer and validates multiple byte offsets:
```byte local_45[5];
status = GetVariable(L"SetupMode", ..., data_size, local_45);

if ((status < 0) ||
    (local_45[4] == 1) ||
    (local_45[3] != 1) ||
    (local_45[2] != 0)) {

    Print("ERROR: Setup Mode not enabled");
}

On this system:
	•	Firmware returns SetupMode as a 1-byte value (0x01)
	•	Higher buffer offsets are not meaningful but are still checked
	•	This causes a valid Setup Mode to be rejected

⸻

Expected Behavior

Mosby should accept a valid SetupMode = 1 result, e.g.:

```status == EFI_SUCCESS && local_45[0] == 1

or validate based on returned data size rather than fixed offsets.

⸻

Impact

This prevents Mosby from running on otherwise valid systems, blocking:
	•	Removal of Microsoft PCA 2011
	•	Installation of Windows UEFI CA 2023


⸻

Suggested Fix

Replace strict buffer validation with a simpler check:
```if (status != EFI_SUCCESS || local_45[0] != 1) {
    error;
}

or validate using returned data size rather than fixed offsets.

This should improve compatibility with OEM firmware implementations.

⸻

Notes
	•	Issue reproduced consistently on Dell OptiPlex 7060

⸻

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions