Page MenuHomeFreeBSD

kinst: check for 'push %rbp' anywhere in the function
ClosedPublic

Authored by christos on May 26 2023, 1:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jan 24, 6:00 PM
Unknown Object (File)
Fri, Jan 24, 5:45 PM
Unknown Object (File)
Fri, Jan 24, 5:32 PM
Unknown Object (File)
Thu, Jan 23, 6:25 PM
Unknown Object (File)
Fri, Jan 17, 4:09 AM
Unknown Object (File)
Fri, Jan 17, 2:28 AM
Unknown Object (File)
Wed, Jan 15, 6:31 PM
Unknown Object (File)
Dec 29 2024, 3:20 AM
Subscribers

Details

Summary

Currently kinst checks if only the first instruction is 'push %rbp',
essentially excluding functions that do push RBP, but not in the first
instruction.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 52668
Build 49559: arc lint + arc unit

Event Timeline

Check for 'pop %rbp' as well.

sys/cddl/dev/kinst/amd64/kinst_isa.c
515–516

The first sentence isn't really accurate anymore. I'd just replace the comment with something like, "refuse to instrument functions lacking the usual frame pointer manipulations since they might correspond to exception handlers."

christos marked an inline comment as done.

Address Mark's comment.

Please note in the commit message that this behaviour matches that of FBT. That is, FBT will put an entry probe on any function that contains a push %rbp.

This revision is now accepted and ready to land.Jul 19 2023, 1:56 PM