REDHAT-BUG-2265648: Null Pointer Dereference

Published Feb 23, 2024
·
Updated

bpf: Fix re-attachment branch in bpftracingprogattach

The following case can cause a crash due to missing attachbtf:

1) load rawtp program 2) load fentry program with rawtp as targetfd 3) create tracing link for fentry program with targetfd = 0 4) repeat 3

In the end we have:

- prog->aux->dsttrampoline == NULL - tgtprog == NULL (because we did not provide targetfd to linkcreate) - prog->aux->attachbtf == NULL (the program was loaded with attachprogfd=X) - the program was loaded for tgtprog but we have no way to find out which one

BUG: kernel NULL pointer dereference, address: 0000000000000058 Call Trace: <TASK> ? die+0x20/0x70 ? pagefaultoops+0x15b/0x430 ? fixupexception+0x22/0x330 ? excpagefault+0x6f/0x170 ? asmexcpagefault+0x22/0x30 ? bpftracingprogattach+0x279/0x560 ? btfobjid+0x5/0x10 bpftracingprogattach+0x439/0x560 sysbpf+0x1cf4/0x2de0 x64sysbpf+0x1c/0x30 dosyscall64+0x41/0xf0 entrySYSCALL64afterhwframe+0x6e/0x76

Return -EINVAL in this situation.

Affected Software

1 affected component
Linux Linux kernel

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade Linux kernel to a version that resolves this vulnerability.

    Patch bpf: Fix re-attachment branch in bpf_tracing_prog_attach
  2. Compensating control

    Avoid triggering the crash by not using the bpf tracing re-attachment path when the program would have missing aux fields (e.g., ensure the program is not loaded in a way that results in missing attach_btf / prog->aux->attach_btf == NULL and dst_trampoline == NULL). Return -EINVAL in this situation rather than attempting re-attachment/link creation.

Event History

Feb 23, 2024
Data Sourced
via Red Hat·01:47 PM
DescriptionSeverityAffected Software

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203