-
Notifications
You must be signed in to change notification settings - Fork 60
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
procstat auxv improvements #1890
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
markjdb
reviewed
Oct 6, 2023
bsdjhb
reviewed
Oct 6, 2023
brooksdavis
force-pushed
the
procstat-auxv-improvements
branch
2 times, most recently
from
October 9, 2023 21:19
f3447cc
to
d287148
Compare
markjdb
reviewed
Oct 11, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we update the procstat.1 man page as well?
brooksdavis
force-pushed
the
procstat-auxv-improvements
branch
from
October 11, 2023 15:30
d287148
to
703431f
Compare
bsdjhb
approved these changes
Oct 12, 2023
lib/libprocstat/libprocstat.c
Outdated
auxv[i].a_un.a_val = *((uint32_t *)ptr); | ||
/* | ||
* Don't sign extend values. Existing entries are positive | ||
* intergers or pointers. Under freebsd32, programs typically |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/intergers/integers/
brooksdavis
force-pushed
the
procstat-auxv-improvements
branch
from
October 13, 2023 18:47
703431f
to
65937ab
Compare
Avoid a weird dance through the union and treat all 32-bit values as unsigned integers. This avoids sign extension of flags and userspace pointers. Reviewed by: markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D42198 (cherry picked from commit 9735cc0)
Making this variable static makes is_elf32_sysctl() and callers thread unsafe. Use a less absurd length for sv_name. The longest name in the system is "FreeBSD ELF64 V2" which tips the scales at 16+1 bytes. We'll almost certainly have other problems if we exceed 32 characters. Reviewed by: markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D42199 (cherry picked from commit 72a4ee2)
Use source struct size not the destination struct size so we copy all the auxv entries, not just the first half of them. Fix a style issue on an adjacent line. Reviewed by: markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D42200 (cherry picked from commit 8f06fab)
Include support for translating 32-bit auxv vectors on non-64-bit platforms that aren't riscv (which has no 32-bit ABI support and probably never will). Reviewed by: markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D42201 (cherry picked from commit 248fe3d)
For reasons unknown, procstat subcommands typically display the command in a 16+overflow column format. However, the command may be up to MAXCOMLEN (19) characters long causing the column to spill into the next one. Since there's plenty of room in the auxv case, bump the column width up to 19 to avoid this issue. While this is a format change 1) users who want to parse the data should use libxo output and 2) this makes it possible to parse reliably with cut. Reviewed by: markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D42202 (cherry picked from commit 8f9f7b4)
As with 32-bit compat, support hybrid auxv vectors in CheriABI procstat.
For ELF auxargs that are pointers, print more capability information in verbose mode.
brooksdavis
force-pushed
the
procstat-auxv-improvements
branch
from
October 16, 2023 17:07
65937ab
to
4b88f1a
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add support for printing auxv arguments as capabilities. Along the way make some fixes to the 32-bit compat code, fix support for hybrid ABIs, and improve the readability of output with wide commands.