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

Backport of cos and rhel-sap verifier issues for 3.19/4.5 #86

Conversation

ovalenti
Copy link
Contributor

Description

Backport of #82

Testing

integration-tests pass with all-integration-tests set at stackrox/collector#1868

There is an unexpected difference betweek kernels compiled with gcc and
clang. The former one doesn't support rcu attributes yet, meaning that
READ_TASK_FIELD_INFO on task->cred produces PTR_TO_BTF_ID. The latter
one does support rcu attribute, and READ_TASK_FIELD_INFO ends up with
PTR_TO_BTF_ID | MEM_RCU | MAYBE_NULL [1]. COS seems to be using clang to
compile the kernel:

    # from /boot/config
    CONFIG_CC_VERSION_TEXT="Chromium OS 16.0_pre484197_p20230405-r12 clang version 16.0.0
    (/var/tmp/portage/sys-devel/llvm-16.0_pre484197_p20230405-r12/work/llvm-16.0_pre484197_p20230405/clang 2916b99182752b1aece8cc4479d8d6a20b5e02da)"

The verifier doesn't like the
null part, and to fix it we need to break a chain of reading and verify
that the cred structure is not null.

[1]: https://lore.kernel.org/bpf/[email protected]/
Along the way silence compiler warnings about task_cred
@ovalenti ovalenti self-assigned this Sep 27, 2024
@ovalenti ovalenti requested a review from a team September 27, 2024 06:34
Copy link
Contributor

@Molter73 Molter73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ovalenti ovalenti merged commit 60ea41e into module-version-2.10 Sep 27, 2024
@ovalenti ovalenti deleted the ovalenti/backport_cos_and_rhel-sap_verifier_issues branch September 27, 2024 10:26
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.

3 participants