| Summary: | Add missing syswraps for lsm_get_self_attr and lsm_set_self_attr | ||
|---|---|---|---|
| Product: | [Developer tools] valgrind | Reporter: | mcermak |
| Component: | general | Assignee: | mcermak |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | mark |
| Priority: | NOR | ||
| Version First Reported In: | 3.26 GIT | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: |
proposed patch
updated patch |
||
|
Description
mcermak
2025-10-13 12:50:30 UTC
Created attachment 185764 [details] proposed patch Tests in progress: https://builder.sourceware.org/buildbot/#/changes/98109 - Missing NEWS entry
- vki-scnums-shared-linux.h defines shared _NR constants. OK
- vki-linux.h defines new vki_lsm_ctx. OK
- priv_syswrap-linux.h defines templates for sm_[get|set]_self_attr. OK
- syswrap-*-linux.c defines all PRE/POST handlers for sm_[get|set]_self_attr. OK
- Note in lsm_get_self_attr PRE handler that size (ARG3) is a pointer to an u32 that is being read and written to.
So it needs to be checked whether it is valid memory.
- lsm_get_self_attr POST, same comment, so needs to use *ARG3.
- lsm_set_self_attr PRE handler is missing a PRE_MEM_READ("lsm_get_self_attr(ctx)", ARG2, ARG3);
(here it isn't a pointer to size, so can be used directly)
Created attachment 187204 [details]
updated patch
Thank you for the review! Updated patch attached, buildbots running...
(In reply to mcermak from comment #3) > Created attachment 187204 [details] > updated patch > > Thank you for the review! Updated patch attached, buildbots running... - The bug number in NEWS is wrong (185764 should be 510563) - PRE(sys_lsm_get_self_attr) looks OK now checking ARG3 as u32 *. - Likewise lsm_get_self_attr POST, OK. - lsm_set_self_attr PRE handler now checks ctx size. OK. Test results also look good. ltp lsm_get/set_self_attr test pass. (There is also a new lsm_list_modules syscall that we aren't handling yet, is there a bug for that?) So, with the NEWS entry bug number fixes this looks good to push. Thanks. Thank you! Pushed as commit 4ad2f953c4132140eac15221ac0a7ca2f89b348c . |