netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Dmitry Safonov <0x7f454c46@gmail.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>, rcu@vger.kernel.org
Subject: Re: [TEST] TCP MD5 vs kmemleak
Date: Tue, 18 Jun 2024 07:40:37 -0700	[thread overview]
Message-ID: <20240618074037.66789717@kernel.org> (raw)
In-Reply-To: <CAJwJo6ZjhLLSiBUntdGT8a6-d5pjdXyVv9AAQ3Yx1W01Nq=dwg@mail.gmail.com>

On Tue, 18 Jun 2024 04:24:08 +0100 Dmitry Safonov wrote:
> Hi Jakub,
> 
> thanks for pinging,
> 
> On Mon, 17 Jun 2024 at 15:24, Jakub Kicinski <kuba@kernel.org> wrote:
> >
> > Hi Dmitry!
> >
> > We added kmemleak checks to the selftest runners, TCP AO/MD5 tests seem
> > to trip it:
> >
> > https://netdev-3.bots.linux.dev/vmksft-tcp-ao-dbg/results/643761/4-unsigned-md5-ipv6/stdout
> >
> > Could you take a look? kmemleak is not infallible, it could be a false
> > positive.  
> 
> Sure, that seems somewhat interesting, albeit at this moment not from
> the TCP side :D
> 
> There is some pre-history to the related issue here:
> https://lore.kernel.org/lkml/0000000000004d83170605e16003@google.com/
> 
> Which I was quite sure being addressed with what now is
> https://git.kernel.org/linus/5f98fd034ca6
> 
> But now that I look at that commit, I see that kvfree_call_rcu() is
> defined to __kvfree_call_rcu() under CONFIG_KASAN_GENERIC=n. And I
> don't see the same kmemleak_ignore() on that path.
> 
> To double-check, you don't have kasan enabled on netdev runners, right?

We do:

CONFIG_KASAN=y
CONFIG_KASAN_GENERIC=y

here's the full config:
https://netdev-3.bots.linux.dev/vmksft-tcp-ao-dbg/results/645202/config

> And then straight away to another thought: the leak-report that you
> get currently is ao_info, which should not happen if kfree_rcu() is
> properly fixed.
> But I'd expect kmemleak to be unhappy with ao keys freeing as well:
> they are currently released with call_rcu(&key->rcu,
> tcp_ao_key_free_rcu), which doesn't have a hint for kmemleak, too.
> 
> I'm going to take a look at it this week. Just to let you know, I'm
> also looking at fixing those somewhat rare flakes on tcp-ao counters
> checks (but that may be net-next material together with tracepoint
> selftests).

Let me add rcu@ to CC, perhaps folks there can guide us on known false
positives with KASAN + kmemleak?

  reply	other threads:[~2024-06-18 14:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-17 14:24 [TEST] TCP MD5 vs kmemleak Jakub Kicinski
2024-06-18  3:24 ` Dmitry Safonov
2024-06-18 14:40   ` Jakub Kicinski [this message]
2024-06-18 16:17     ` Paul E. McKenney
2024-06-18 16:30     ` Paolo Abeni
2024-06-18 16:42       ` Paul E. McKenney
2024-06-18 17:02         ` Jakub Kicinski
2024-06-18 17:04           ` Uladzislau Rezki
2024-06-18 17:47           ` Paul E. McKenney
2024-06-19  0:33             ` Dmitry Safonov
2024-06-20 17:02               ` Paul E. McKenney
2024-07-02  2:08                 ` Dmitry Safonov
2024-07-08 11:05                   ` Catalin Marinas
2024-07-08 18:29                   ` Paul E. McKenney

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=20240618074037.66789717@kernel.org \
    --to=kuba@kernel.org \
    --cc=0x7f454c46@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=rcu@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).