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
F125810498: D40283.id124854.diff
Tue, Aug 12, 6:26 AM
Unknown Object (File)
Sun, Jul 27, 11:55 PM
Unknown Object (File)
Sun, Jul 20, 2:16 AM
Unknown Object (File)
Sat, Jul 19, 6:53 PM
Unknown Object (File)
Sat, Jul 19, 9:55 AM
Unknown Object (File)
Jul 12 2025, 11:45 AM
Unknown Object (File)
Jun 27 2025, 1:29 AM
Unknown Object (File)
Jun 23 2025, 5:26 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 51708
Build 48599: 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