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
F108308761: D40283.id122608.diff
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)
Sun, Dec 29, 3:20 AM
Unknown Object (File)
Dec 12 2024, 12:27 PM
Unknown Object (File)
Dec 2 2024, 1:44 PM
Unknown Object (File)
Nov 24 2024, 3:25 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