mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hans Liljestrand <liljestrandh@gmail.com>
To: Kees Cook <keescook@chromium.org>
Cc: "Reshetova, Elena" <elena.reshetova@intel.com>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>, LKP <lkp@01.org>
Subject: Re: [lkp-robot] [x86/refcount] b631e535c6: WARNING:at_net/netlink/af_netlink.c:#netlink_sock_destruct
Date: Thu, 27 Jul 2017 16:34:24 +0300	[thread overview]
Message-ID: <20170727133424.nk45rutdleyirva2@ishxps> (raw)
In-Reply-To: <CAGXu5jJb=iqctW_XETSKjpA9zMPkqdmeKqdcWazhAwKZ=ZPkhw@mail.gmail.com>

On Tue, Jul 25, 2017 at 11:38:30AM -0700, Kees Cook wrote:
>On Tue, Jul 25, 2017 at 3:43 AM, Hans Liljestrand
><liljestrandh@gmail.com> wrote:
>> On Mon, Jul 24, 2017 at 08:21:16PM -0700, Kees Cook wrote:
>>>
>>> On Mon, Jul 24, 2017 at 6:03 AM, Hans Liljestrand
>>> <liljestrandh@gmail.com> wrote:
>>>>
>>>> On Sun, Jul 23, 2017 at 08:52:53PM -0700, Kees Cook wrote:
>>>>>
>>>>>
>>>>> Is 14afee4b6092f ("net: convert sock.sk_wmem_alloc from atomic_t to
>>>>> refcount_t") correct? That looks like a statistics counter, not a
>>>>> refcounter? I can't quite tell, though...
>>>>
>>>>
>>>>
>>>> Hmm, yes, it looks a bit weird, but it is used in a refcount fashion
>>>> here:
>>>>
>>>> void sk_free(struct sock *sk)
>>>> {
>>>>         /*
>>>>          * We subtract one from sk_wmem_alloc and can know if
>>>>          * some packets are still in some tx queue.
>>>>          * If not null, sock_wfree() will call __sk_free(sk) later
>>>>          */
>>>>         if (refcount_dec_and_test(&sk->sk_wmem_alloc))
>>>>                 __sk_free(sk);
>>>> }
>>>>
>>>> http://elixir.free-electrons.com/linux/v4.13-rc1/source/net/core/sock.c#L1605
>>>
>>>
>>> Ah yeah, there it is. Hrmpf. Something is triggering WARNs, though...
>>> I wonder if this can get examined more closely?
>>
>>
>> I tried reproducing the error but I don't seem to know how to use lkp. Got
>> lots of permission denied errors and finally ran out of disk space (after
>> using up ~50GB).
>>
>> Maybe I did something wrong?
>>
>> What I did was: Cloned the related kernel repository, checked out offending
>> commit, plopped in config, compiled bzImage. Then I just cloned the lkp repo
>> and tried running the provided command line with the bzImage and provided
>> script.
>>
>> I'll take another look once I have the time, might be I missed something
>> earlier.
>
>Yeah, I'm not sure. Seems it was found through trinity? And only after
>36 seconds, too.

I think I might have missed something here? I cannot find anything about 
trinity or 36 seconds? Although I either misplaced or didn't get the original 
email, so I'm not sure if it had some other attachments beyond the config and 
script?

>
>>> Also, why not atomic->refcount for sk_rmem_alloc?
>>
>> I couldn't find any similar refcount-like use on sk_rmem_alloc.
>
>Okay, interesting.
>
>> And as noted the sk_wmem_alloc thing is also a bit dubious. It looks like it
>> serves a dual purpose of actual allocation size and occasional reference
>> counter.
>
>Could you ask net-dev to see what is actually happening here? This
>looks like a regression, but also very odd (broken?) refcounting ...

Sure, but I'm unsure of what exactly I should be asking? If you have any more 
information on the trinity results I'd be happy to look at that beforehand?

Thanks,
-hans

>
>-Kees
>
>
>-- 
>Kees Cook
>Pixel Security

      reply	other threads:[~2017-07-27 13:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-24  2:13 kernel test robot
2017-07-24  3:52 ` Kees Cook
2017-07-24 13:03   ` Hans Liljestrand
2017-07-25  3:21     ` Kees Cook
2017-07-25 10:43       ` Hans Liljestrand
2017-07-25 18:38         ` Kees Cook
2017-07-27 13:34           ` Hans Liljestrand [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=20170727133424.nk45rutdleyirva2@ishxps \
    --to=liljestrandh@gmail.com \
    --cc=elena.reshetova@intel.com \
    --cc=jpoimboe@redhat.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@01.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

all inboxes | Powered by JetHome®