-
Notifications
You must be signed in to change notification settings - Fork 501
Bleeding Edge Kernel versions drop module_sect_attr #1761
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
Comments
I hate to say it, but this is a new feature ("support recent kernels") rather than a fix for something that currently works incorrectly, and I don't think it's enough to break the code freeze. It doesn't yet affect mainstream kernels (you said it was bleeding edge), the existing code isn't broken it just can't handle all cases at the moment (which will always be the case in a moving world) and we have to cut at some point. Feel free to get it fixed in develop, and it'll get released in July or August, whenever our next release is due to be rolled. |
It's not a parity release issue since I'm pretty sure volatility 2 will not handle this case. |
The updated method for module attributes (the reason for this ticket) is in released Ubuntu preview kernels now, which means over the next couple weeks they will go into stable kernels being used in production. It is also not a silent issue, it fully backtraces all of Vol3 for any Linux analysis as we set the extension for |
Well, I'll take a look at the PR once it comes out to see how invasive it is, but targetting a fix for something that comes out in two weeks, is still pre-empting the future, so I'm absolutely middle of the line on this and it could go either way... |
(It also proves we need to be careful about whether we add class overrides or optional class overrides when we add extensions). |
Yes, but two weeks from now is during the bug release period. Also, that would put 2-3 months of Linux analysis on up to date kernels backtracking and we just be telling people to use devleop for 2 months instead of the release. Also, we do use the optional classes correctly, and it is good we didn't use it here as its a core data structure that hasn't changed since ~15 years - but of course it gets changed right before release. It would be like EPROCESS suddenly disappearing on Windows. |
Ok, I'm glad we chose the right type for the structure, and yes, it's very disappointing they decided to make that change now. As I said, I take a look and see how risky a change it is, but we have to balance it against putting in the change and us getting it wrong or missing something and breaking volatility (perhaps for every linux image, not just new ones) which is why I'm not giving you a guaranteed yes, or a guaranteed no now, but we need to see what the patch looks like before we decide whether it's better to include it now or not. The fact that it breaks all linux analysis rather than just one plugin does swing things in favour of including it. |
Here are my researches towards a fix, if it can help you determine which way to go. Doc.At first glance, the only place where we require "module_sect_attr" is in volatility3/volatility3/framework/symbols/linux/extensions/__init__.py Lines 211 to 219 in 842d0e7
Diff is here: // https://elixir.bootlin.com/linux/v6.13/source/kernel/module/sysfs.c#L27
struct module_sect_attrs {
struct attribute_group grp;
unsigned int nsections;
struct module_sect_attr attrs[];
}; -> // https://elixir.bootlin.com/linux/v6.14-rc6/source/kernel/module/sysfs.c#L22
struct module_sect_attrs {
struct attribute_group grp;
struct bin_attribute attrs[];
}; And the now removed module_sect_attr was: struct module_sect_attr {
struct bin_attribute battr;
unsigned long address;
};
Fix
diff --git a/volatility3/framework/symbols/linux/extensions/__init__.py b/volatility3/framework/symbols/linux/extensions/__init__.py
index b4bde1ab..74ad205b 100644
--- a/volatility3/framework/symbols/linux/extensions/__init__.py
+++ b/volatility3/framework/symbols/linux/extensions/__init__.py
@@ -212,9 +212,7 @@ class module(generic.GenericIntelProcess):
symbol_table_name + constants.BANG + "array",
layer_name=self.vol.layer_name,
offset=self.sect_attrs.attrs.vol.offset,
- subtype=self._context.symbol_space.get_type(
- symbol_table_name + constants.BANG + "module_sect_attr"
- ),
+ subtype=self.sect_attrs.attrs.vol.subtype,
count=self.number_of_sections,
) Then add an optional "bin_attribute" class override with a "get_name" method that should basically only need to mimic
|
I'll potentially update the previous comment if I find anything else, so consider this WiP for today. |
So it sounds like the fix would be to make a |
I don't think there is a need to tamper with volatility3/volatility3/framework/symbols/linux/utilities/module_extract.py Lines 292 to 306 in 842d0e7
I can make a PR with how I think it could be resolved, so that it would a bit clearer of what would move and if it's too risky or not before 2.26.0. |
This is a struct we currently rely on to extract kernel modules. This structure has been there since the beginning of the kernel but was removed with this commit:
torvalds/linux@34f5ec0
A slack user reported the bug from a preview/bleeding edge Ubuntu kernel, so this will hit mainstream kernels soon enough. I will investigate this week so its fixed for parity.
The text was updated successfully, but these errors were encountered: