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)
Mar 17 2024, 10:42 AM
Unknown Object (File)
Mar 14 2024, 6:24 PM
Unknown Object (File)
Mar 14 2024, 6:24 PM
Unknown Object (File)
Mar 14 2024, 6:24 PM
Unknown Object (File)
Mar 14 2024, 6:24 PM
Unknown Object (File)
Mar 11 2024, 5:33 AM
Unknown Object (File)
Jan 3 2024, 4:05 PM
Unknown Object (File)
Dec 10 2023, 9:46 PM
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 Not Applicable
Unit
Tests Not Applicable

Event Timeline

Check for 'pop %rbp' as well.

sys/cddl/dev/kinst/amd64/kinst_isa.c
519–520

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