Skip to content
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

Fix status message parsing on different kernels #12

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

vthib
Copy link

@vthib vthib commented Jul 21, 2023

First of all, thanks for this crate! I've been testing it in different environments and came upon an issue on older kernel versions. The StatusMessage has different length and fields depending on the kernel version, and it failed to parse correctly on centos7 for example, because of a received payload that was too short.

This PR does two things:

  • it fixes the parsing on older kernel versions. I've looked at a 2.6.32 one and up to a 6.4.3 one
  • it adds a new field added since the 5.9 kernel

audit_status struct on a 2.6.32 (centos6):

image

audit_status struct on a 6.4.3 (arch):

image

vthib added 2 commits July 21, 2023 11:52
The status message has evolved, with fields being added in subsequent
kernel versions. The parsing of this message excepts a recent version of
it, making it fail to parse on older kernels.

This is fixed by putting the newer fields behind an option. On parsing,
those are set only if the received status payload is big enough.
This is a rather new field, seemingly present since the 5.9 kernel.
@vthib vthib force-pushed the fix-status-message-different-kernels branch from b64763a to ac6e4ce Compare July 21, 2023 09:53
@vthib
Copy link
Author

vthib commented Sep 19, 2023

@cathay4t Can you take a look at the 3 PRs I submitted when you can?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant