netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: "Daniël Sonck" <dsonck92@gmail.com>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>
Subject: Re: BUG: kernel NULL pointer dereference in __cgroup_bpf_run_filter_skb
Date: Sun, 14 Jun 2020 11:29:34 -0700	[thread overview]
Message-ID: <CAM_iQpUKQJrj8wE+Qa8NGR3P0L+5Uz=qo-O5+k_P60HzTde6aw@mail.gmail.com> (raw)
In-Reply-To: <CAMtihapJKityT=urbrx2yq-csRQ4u7Vcosrf0NzUZtrHfmN0cQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1065 bytes --]

Hello,

On Sun, Jun 14, 2020 at 5:39 AM Daniël Sonck <dsonck92@gmail.com> wrote:
>
> Hello,
>
> I found on the archive that this bug I encountered also happened to
> others. I too have a very similar stacktrace. The issue I'm
> experiencing is:
>
> Whenever I fully boot my cluster, in some time, the host crashes with
> the __cgroup_bpf_run_filter_skb NULL pointer dereference. This has
> been sporadic enough before not to cause real issues. However, as of
> lately, the bug is triggered much more frequently. I've changed my
> server hardware so I could capture serial output in order to get the
> trace. This trace looked very similar as reported by Lu Fengqi. As it
> currently stands, I cannot run the cluster as it's almost instantly
> crashing the host.

This has been reported for multiple times. Are you able to test the
attached patch? And let me know if everything goes fine with it.

I suspect we may still leak some cgroup refcnt even with the patch,
but it might be much harder to trigger with this patch applied.

Thanks.

[-- Attachment #2: cgroup_sk_alloc.diff --]
[-- Type: text/x-patch, Size: 614 bytes --]

diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 6c9c6ac83936..c01245a19ea2 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -6438,9 +6438,6 @@ void cgroup_sk_alloc_disable(void)
 
 void cgroup_sk_alloc(struct sock_cgroup_data *skcd)
 {
-	if (cgroup_sk_alloc_disabled)
-		return;
-
 	/* Socket clone path */
 	if (skcd->val) {
 		/*
@@ -6453,6 +6450,9 @@ void cgroup_sk_alloc(struct sock_cgroup_data *skcd)
 		return;
 	}
 
+	if (cgroup_sk_alloc_disabled)
+		return;
+
 	/* Don't associate the sock with unrelated interrupted task's cgroup. */
 	if (in_interrupt())
 		return;

  reply	other threads:[~2020-06-14 18:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-14 12:37 BUG: kernel NULL pointer dereference in __cgroup_bpf_run_filter_skb Daniël Sonck
2020-06-14 18:29 ` Cong Wang [this message]
2020-06-14 20:43   ` Daniël Sonck
2020-06-15 13:05     ` Daniël Sonck
2020-06-15 21:34       ` Cong Wang
2020-07-06 21:39   ` Tilman Klaeger
  -- strict thread matches above, loose matches on Subject: below --
2020-05-30  7:46 Lu Fengqi
2020-06-02 21:46 ` Brenden Blanco
2020-06-02 22:17   ` Alexei Starovoitov
2020-06-03  6:20     ` Lu Fengqi
2020-06-03  8:22       ` Lu Fengqi
2020-06-09 20:50     ` Daniel Borkmann
2020-06-10  1:37       ` Zefan Li
2020-06-03  6:16   ` Lu Fengqi

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='CAM_iQpUKQJrj8wE+Qa8NGR3P0L+5Uz=qo-O5+k_P60HzTde6aw@mail.gmail.com' \
    --to=xiyou.wangcong@gmail.com \
    --cc=dsonck92@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).