-
Notifications
You must be signed in to change notification settings - Fork 21
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
Advanced Usage Documentaiton out of date #284
Comments
kmaxall arch/x86_64 block certs crypto drivers fs init ipc kernel lib mm net security sound usr virt > kmaxallOutput.txt should, I think do the trick? hitting this error at some point: kmax -Dsrc=arch/x86_64 -Dsrctree=./ -z arch/x86_64 |
changed kmaxall, line 219 to: sys.stderr.write(err.decode('utf-8')) |
Hi @joh-nnyS thanks for looking into this and apologies for the out of date documentation. Indeed kmax may gave changed interface, but it should still be possible to get conditions for each source file. kmaxall is the right place to start. klocalizer has code that uses kmaxall to get each files conditions. I'll take a look at this and try to get you the right commands. It may just require reading in some pickled data structure. For conditions output is smt-lib2 output okay for the conditions? |
Hi @joh-nnyS , I'm having trouble replicating your bug. I tried kmaxall on Linux 4.19.323, but I was able to generate constraints with the command you used. One thing is that 4.19.323 doesn't seem to have an Could you let me know what version of python you have installed and how you installed kmax? (I'm using python 3.12.3 and kmax is installed via pipx). Also, I don't see the Otherwise, your
kreader shows how to read the output of Note that there is a special function to conjoin the conditions for a compilation unit's parent directories. For instance, to get the complete constraints for
becomes
|
@paulgazz I appreciate the reply, thank you for taking the time! I was running the command in two ways, both resulting in the error above:
I was however running them on a modifled version of the 4.19.323 Kernel. Though looking at the patches we've applied I don't see how that would result in the error. Can't rule these out as the cause though. I'll try to run again on a unpached version of the kernel to rule this out and will get back to you if the error occurs again. I had stumbled across kreader in the meantime but did not have the time to play with it yet. I'm not sure I qualify for a PR to update the documentation yet, but having looked at your tool some more I can see other use cases (I think). So we'll see. In the meantime, I hope, this issue should help anyone who stumbles across the same thing. Thanks again! |
Hey @paulgazz,
I'm trying to output a list of configuration conditions for each compilation unit of linux kernel source. My use case is to see under which conditions which source file is compiled. It looks like this was (and probably still is) possible:
https://github.com/paulgazz/kmax/blob/master/docs/advanced.md#simple-example
https://github.com/paulgazz/kmax/blob/master/docs/advanced.md#example-on-linux
However the documentation for this seems outdated? The -g option does not even exist anymore? I'm looking at the source code now trying to piece together what I need. Might make a PR to update the documentation for this use case when I get there.
I'd appreciate any help of course. Specifically I'm working with the 4.19.323 Kernel. Endgoal is to to automate the process of checking whether Kernel CVEs may be disregarded due to kernel config/ be able to tell which CVEs we may get rid of by disabling possibly not needed options.
The text was updated successfully, but these errors were encountered: