From: bot+bpf-ci@kernel.org
To: liujing@cmss.chinamobile.com,ast@kernel.org
Cc: daniel@iogearbox.net,andrii@kernel.org,eddyz87@gmail.com,memxor@gmail.com,martin.lau@linux.dev,song@kernel.org,yonghong.song@linux.dev,jolsa@kernel.org,emil@etsalapatis.com,ihor.solodrai@linux.dev,bpf@vger.kernel.org,linux-kernel@vger.kernel.org,liujing@cmss.chinamobile.com,ast@kernel.org,andrii@kernel.org,daniel@iogearbox.net,martin.lau@kernel.org,eddyz87@gmail.com,yonghong.song@linux.dev,mason@kernel.org,ihor.solodrai@linux.dev
Subject: Re: [PATCH] bpf: cgroup: fix null-ptr-deref in __cgroup_bpf_attach
Date: Wed, 2 Sep 2026 09:52:45 +0000 (UTC) [thread overview]
Message-ID: <bb0be5fe0febe96dd7a31501655a1b27bca3035b2c95a80b5f46fd0134e0ffa4@mail.kernel.org> (raw)
In-Reply-To: <20260902090220.16395-1-liujing@cmss.chinamobile.com>
[-- Attachment #1: Type: text/plain, Size: 862 bytes --]
> bpf: cgroup: fix null-ptr-deref in __cgroup_bpf_attach
>
> In __cgroup_bpf_attach(), the expression "prog ? : link->link.prog"
> dereferences link before validating that link is non-NULL. If both
> prog and link are NULL (a contract violation by the caller), this
> causes a null pointer dereference.
>
> Add a safe ternary fallback and a NULL check for new_prog before
> it is used further.
>
> Signed-off-by: Liu Jing <liujing@cmss.chinamobile.com>
This looks like a bug fix. Should this include:
Fixes: af6eea57437a ("bpf: Implement bpf_link-based cgroup BPF program attachment")
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/33613365877
prev parent reply other threads:[~2026-09-02 9:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 9:02 Liu Jing
2026-09-02 9:41 ` Jiayuan Chen
2026-09-08 16:00 ` Emil Tsalapatis
2026-09-02 9:52 ` bot+bpf-ci [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bb0be5fe0febe96dd7a31501655a1b27bca3035b2c95a80b5f46fd0134e0ffa4@mail.kernel.org \
--to=bot+bpf-ci@kernel.org \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=ihor.solodrai@linux.dev \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liujing@cmss.chinamobile.com \
--cc=martin.lau@kernel.org \
--cc=martin.lau@linux.dev \
--cc=mason@kernel.org \
--cc=memxor@gmail.com \
--cc=song@kernel.org \
--cc=yonghong.song@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®