← 输入框|github.com|刷新
Skip to content

Fuzz fixes - #407

Draft
JohnAZoidberg wants to merge 2 commits into
mainfrom
fuzz-fixes
Draft

JohnAZoidberg wants to merge 2 commits into
mainfrom
fuzz-fixes

Conversation

@JohnAZoidberg

Copy link
Copy Markdown
Member

No description provided.

read_memory() returns None if the platform isn't detected as Framework
or the driver fails, but many callers unwrapped it. power_info() and
get_accel_data() are also used by the UEFI app embedded in the BIOS,
where a panic stops the boot.

- read_u32/read_string return Option, add read_u8, and power_info()
  returns None if any read fails
- get_accel_data() reads the whole block at once and returns zeros and
  an unreliable lid angle if that fails
- AccelData::from doesn't index past short data
- print_sensors() doesn't index past the sensor locations the EC reported
- get_fan_num() returns an error instead of panicking
The EC sends 0xFF as board ID if it fails to read the ADC
(BOARD_VERSION_UNKNOWN). Any value we don't know would panic, which in
the UEFI app embedded in the BIOS stops the boot.

Slots can hold modules with board IDs we don't recognize, so map those
to InputModuleType::Unknown(u8). An unknown module has size 0 and an
unknown touchpad is treated as not present.

The deck state is an EC state machine value, an unknown one is an error.
Decode it with TryFrom and return an EcError from
get_input_deck_status/set_input_deck_mode instead of panicking.
--inputdeck-mode prints that error instead of unwrapping it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant