Skip to content

intel PT: check for availability in VMX #3328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 9, 2025

Conversation

Marcondiro
Copy link
Contributor

Description

intel PT: check for availability in VMX

Check a CPU MSR to ensure that the CPU supports PT tracing in VMs

Checklist

  • I have run ./scripts/precommit.sh and addressed all comments

.read(true)
.open("/dev/cpu/0/msr")
.map_err(|e| {
format!(
Copy link
Member

Choose a reason for hiding this comment

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

Why not use proper errors here?

Copy link
Contributor Author

@Marcondiro Marcondiro Jul 7, 2025

Choose a reason for hiding this comment

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

you mean an enum of some kind?
In the end the availability checks are made to display possible reasons of PT unavailability to users, not to other parts of the code so adding enums with display method ecc feels just useless bilerplate

Copy link
Member

Choose a reason for hiding this comment

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

Just the normal libafl Error, returning a String as error is dirty

Copy link
Contributor Author

Choose a reason for hiding this comment

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

wrapping everything in an Unsupported or Unknown libafl error just to call to_string in the other side isn't cleaner nor useful since it adds useless stuff in the print :D

Copy link
Member

Choose a reason for hiding this comment

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

It's more like OsError right? Still a better love story than Strings IMHO

@domenukk
Copy link
Member

domenukk commented Jul 9, 2025

I guess for an internal function it doesn't matter much. In the future prefer proper errors though

@domenukk domenukk merged commit bdbd509 into AFLplusplus:main Jul 9, 2025
109 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.

2 participants