netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: "Linux Kernel Network Developers" <netdev@vger.kernel.org>,
	"Cameron Berkenpas" <cam@neo-zeon.de>,
	"Peter Geis" <pgwipeout@gmail.com>,
	"Lu Fengqi" <lufq.fnst@cn.fujitsu.com>,
	"Daniël Sonck" <dsonck92@gmail.com>,
	"Zhang Qiang" <qiang.zhang@windriver.com>,
	"Thomas Lamprecht" <t.lamprecht@proxmox.com>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Zefan Li" <lizefan@huawei.com>, "Tejun Heo" <tj@kernel.org>,
	"Roman Gushchin" <guro@fb.com>
Subject: Re: [Patch net v2] cgroup: fix cgroup_sk_alloc() for sk_clone_lock()
Date: Fri, 10 Jul 2020 09:42:24 -0700	[thread overview]
Message-ID: <20200710164224.GA179556@roeck-us.net> (raw)
In-Reply-To: <CAM_iQpWaWcJYG_JWkHdy__=Y5NYPFaX2T+W-c6MskYoZ8G7rRQ@mail.gmail.com>

On Thu, Jul 09, 2020 at 11:59:09AM -0700, Cong Wang wrote:
> On Thu, Jul 9, 2020 at 11:51 AM Cong Wang <xiyou.wangcong@gmail.com> wrote:
> >
> > On Thu, Jul 9, 2020 at 10:10 AM Guenter Roeck <linux@roeck-us.net> wrote:
> > >
> > > Something seems fishy with the use of skcd->val on big endian systems.
> > >
> > > Some debug output:
> > >
> > > [   22.643703] sock: ##### sk_alloc(sk=000000001be28100): Calling cgroup_sk_alloc(000000001be28550)
> > > [   22.643807] cgroup: ##### cgroup_sk_alloc(skcd=000000001be28550): cgroup_sk_alloc_disabled=0, in_interrupt: 0
> > > [   22.643886] cgroup:  #### cgroup_sk_alloc(skcd=000000001be28550): cset->dfl_cgrp=0000000001224040, skcd->val=0x1224040
> > > [   22.643957] cgroup: ###### cgroup_bpf_get(cgrp=0000000001224040)
> > > [   22.646451] sock: ##### sk_prot_free(sk=000000001be28100): Calling cgroup_sk_free(000000001be28550)
> > > [   22.646607] cgroup:  #### sock_cgroup_ptr(skcd=000000001be28550) -> 0000000000014040 [v=14040, skcd->val=14040]
> > > [   22.646632] cgroup: ####### cgroup_sk_free(): skcd=000000001be28550, cgrp=0000000000014040
> > > [   22.646739] cgroup: ####### cgroup_sk_free(): skcd->no_refcnt=0
> > > [   22.646814] cgroup: ####### cgroup_sk_free(): Calling cgroup_bpf_put(cgrp=0000000000014040)
> > > [   22.646886] cgroup: ###### cgroup_bpf_put(cgrp=0000000000014040)
> >
> > Excellent debugging! I thought it was a double put, but it seems to
> > be an endian issue. I didn't realize the bit endian machine actually
> > packs bitfields in a big endian way too...
> >
> > Does the attached patch address this?
> 
> Ah, this is too ugly. We just have to always make them the last two bits.
> 
> Please test this attached patch instead and ignore the previous one.
> 

Sorry, that one came too late; I was already about to leave when I got the first
one. It looks correct, though. I'll be back Monday night and will have another
look then (and I guess my builders will pick it up after Dave sends it all to
Linus). I'll let you know if I still see a problem.

Thanks,
Guenter

  reply	other threads:[~2020-07-10 16:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-02 18:52 [Patch net v2] cgroup: fix cgroup_sk_alloc() for sk_clone_lock() Cong Wang
2020-07-07 20:34 ` David Miller
2020-07-08 15:33 ` Guenter Roeck
2020-07-08 18:34   ` Cong Wang
2020-07-08 19:07     ` Guenter Roeck
2020-07-08 19:32       ` Cong Wang
2020-07-08 20:00         ` Guenter Roeck
2020-07-09 17:10         ` Guenter Roeck
2020-07-09 18:51           ` Cong Wang
2020-07-09 18:59             ` Cong Wang
2020-07-10 16:42               ` Guenter Roeck [this message]
2020-07-14 13:55               ` Guenter Roeck
2020-07-09 19:13             ` Guenter Roeck
2020-07-09 19:19               ` Cong Wang
2020-07-09 23:26                 ` David Miller

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=20200710164224.GA179556@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=cam@neo-zeon.de \
    --cc=daniel@iogearbox.net \
    --cc=dsonck92@gmail.com \
    --cc=guro@fb.com \
    --cc=lizefan@huawei.com \
    --cc=lufq.fnst@cn.fujitsu.com \
    --cc=netdev@vger.kernel.org \
    --cc=pgwipeout@gmail.com \
    --cc=qiang.zhang@windriver.com \
    --cc=t.lamprecht@proxmox.com \
    --cc=tj@kernel.org \
    --cc=xiyou.wangcong@gmail.com \
    /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).