-
Notifications
You must be signed in to change notification settings - Fork 623
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
Support extracting symbols in .dynsym section for GraalVM Native Images #3647
Conversation
…ELF files Signed-off-by: Joel Rudsberg <joel.rudsberg@oracle.com>
c5128b8
to
cdc3db8
Compare
Hi @kzantow - Are you or some other team member available to review this small PR in the near future? |
Hi @kzantow, any update? We're eager to get these changes in Syft! :) |
How many symbols would be added to the SBOM for these packages (say on average)? Ideally there would be a test that asserts the expected set of symbols from a test fixture. |
Just to make sure I understand where the question comes from; are you concerned that Syft would spend too much time/memory on reading the (dynamic) symbol table from the ELF? Note that symbols are added to the ELF, not the SBOM. The SBOM is stored in the symbol named |
@wagoodman, as @martijndwars pointed out: the relevant symbols ( My suggestion is that we merge this so users like @martijndwars can extract SBOMs with syft using newer versions of Native Image. If there's interest from the syft team to improve the general integration testing using Oracle GraalVM, that would be appropriately done in another PR. |
@martijndwars @rudsberg thanks for the corrections -- I assumed that there was a need to extract symbols for the intention of having more detail in the SBOM, but now I see that this is really a response to a change upstream and the cataloging behavior is still the same. Regarding the test update, I agree, that improvement can always come in another PR (I see how that would be more difficult to test here!). |
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.
Thanks for the contribution!
Description
This PR adds support for extracting SBOMs embedded in native images where the SBOM symbols are saved in the
.dynsym
section of ELF files. Newer versions of GraalVM Native Image saves the SBOM symbols in the.dynsym
section while older versions saves them in the.symtab
section. This PR ensures SBOM extraction works in both cases.Type of change
Checklist:
*No additional tests were added. The new
getSymbols
function is exercised via TestParseNativeImage that calls fetchPkgs. This is a negative test testing that an error is thrown when SBOM extraction is attempted on a native image that wasn't created with an embedded SBOM.