Skip to content

Conversation

@sgress454
Copy link
Contributor

From Fleet: fleetdm/fleet#21648

This PR fixes an issue where Lenovo laptops report the hardware model and version incorrectly in the BIOS tables, resulting in incorrect values in the hardware_model and hardware_version columns of the system_info table. This issue affects both Windows and Linux. See fleetdm/fleet#21648 (comment) for examples of the undesirable output.

The fixes in this PR are:

  • For Linux, swap the hardware_model and hardware_version values. The reported version is something like ThinkPad L15 Gen 3 which is consistent with the kind of value typically reported as hardware_model from other vendors. The reported version is something like 21C8S3EA00 which appears to be a product SKU, which can serve as the "version" for this model.
  • For Windows, retrieve the model name from the Win32_ComputerSystemProduct WMI class, and move the reported hardware_model into hardware_version as above.

Results:

image

@sgress454 sgress454 requested review from a team as code owners January 21, 2025 17:24
Copy link
Contributor

@lucasmrod lucasmrod left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@zwass zwass left a comment

Choose a reason for hiding this comment

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

Thank you @sgress454! Will merge when CI passes (just kicked off run).

Copy link
Member

@zwass zwass left a comment

Choose a reason for hiding this comment

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

Looks like there's a mismatched bracket somewhere in the Windows code. Please fix that. https://github.com/osquery/osquery/actions/runs/12892403902/job/36019373348?pr=8534#step:22:9090

@sgress454 sgress454 force-pushed the sgress454/21648-fix-hardware-model-on-lenovo branch 2 times, most recently from 89590dc to b734fe9 Compare January 23, 2025 20:15
@sgress454
Copy link
Contributor Author

Looks like there's a mismatched bracket somewhere in the Windows code. Please fix that. https://github.com/osquery/osquery/actions/runs/12892403902/job/36019373348?pr=8534#step:22:9090

No idea how that got in there, fixed now 👍

@sgress454
Copy link
Contributor Author

@zwass please re-run those tests when you get a chance!

@zwass
Copy link
Member

zwass commented Jan 23, 2025

Now there's a code style failure. Make sure to run the code format check locally to make this easier (see the build docs).

@sgress454 sgress454 force-pushed the sgress454/21648-fix-hardware-model-on-lenovo branch from b734fe9 to 9a5f8b9 Compare January 27, 2025 17:16
@sgress454
Copy link
Contributor Author

Now there's a code style failure. Make sure to run the code format check locally to make this easier (see the build docs).

@zwass Fixed!

Copy link
Member

@zwass zwass left a comment

Choose a reason for hiding this comment

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

Thanks! Will merge when CI completes.

@zwass zwass merged commit 080833e into osquery:master Jan 28, 2025
22 checks passed
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.

3 participants