-
Notifications
You must be signed in to change notification settings - Fork 28
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
Linux module method #12
base: master
Are you sure you want to change the base?
Conversation
Addeding --reference-symbols flag that can be used to specify a reference symbols file that is used to obtain the symbol types for matching symbol names.
e3487d3
to
cadb50d
Compare
Dear @ilch1, I tested this PR, but I did not get it to work with a kernel in version 5.10.0.9 on Debian Bullseye. First, I compiled the sudo ./dwarf2json linux \
--elf-types ./linux_build_module/module.ko \
--system-map System.map.txt \
--linux-banner "$(cat banner.txt)" \
--reference-symbols reference.json on an exact same system just without the debug-symbol. Could you clarify, whether this is a bug or an error on my side? Thank you already in advance for a short reply. Best regards, |
Hi @jgru, Thanks for trying out the branch and providing feedback. The error is indicative on an issue with parsing the DWARF in Regards, |
Hi @ilch1, thanks for getting back to me. Please see the attached Looking foward for this feature becoming usable. Thank you very much for working on this! Regards, |
I haven't looked through the PR, but I'd like to make sure there's a way to differentiate ISF files made using a full kernel and those made using the I'm just worried there'll be a symbol that we don't currently put in the module, but that we'll come to rely on and (even though people should support kernels before/after the symbol exists) I suspect some plugins won't fail gracefully. Providing them a means to do so would be really advantageous (particularly versioned, so if we add a symbol to the |
Hi @jgru, I'm not able to reproduce the reported error and can generate an ISF with the files you provided. I'm likely using a different Running a couple of other commands would help with debugging this discrepancy.
Could you try ^^^ and report the results? Thanks, |
Hi Ilya, thanks for getting back to me. go version
go version go1.14 linux/amd64 Running the command as you proposed resulted in the exact same error:
Thanks, |
Hi Ilya, I upgraded Go to version 1.17.5, but nothing changed when running the a/m command, however. Regards, |
Hi @ikelos, You are raising valid points. I agree that it would be useful to differentiate ISF files created with debug kernels and those created with module.ko method. The ISF files stores metadata for each source used for its creation. This includes names of files and would show that I want to clarify that |
Hi @jgru, Thanks for this additional information. It looks like I had a small code change in my local repo that hasn't been committed. It explains the difference in behavior that we were seeing. Can you try to apply the following patch locally and see if it works for you:
It undoes a fix for a different DWARF processing problem, so it won't go in this way. Thanks, |
Yep, it might be worth including an additional field in the file that a) identifies it as based on module.ko and b) contains the version of |
Hi @ilch1, I applied the patch and was able to generate a JSON-file using Regards, |
It's worth discussing. The current interface to It is definitely possible to change the interface to |
I agree, that's why I figured it had to be something specific that existed in the DWARF output of |
I think we would remove options (such as |
Add support for generating a symbols file when debug symbols for a Linux kernel are not available.
The types can be obtained from a kernel module that is compiled against the kernel headers (same approach as in volatility2 profiles). Symbol addresses and names come from System.map. This PR provides the following additional features: