lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <3458658.QJadu78ljV@ripper>
Date: Thu, 21 Dec 2023 09:36:38 +0100
From: Sven Eckelmann <sven@...fation.org>
To: b.a.t.m.a.n@...ts.open-mesh.org, Catalin Marinas <catalin.marinas@....com>
Cc: Jinho Ju <wnwlsgh98@...il.com>, netdev@...r.kernel.org, linux-mm@...ck.org
Subject: Re: Fwd: Fwd: memory leak in batadv_iv_ogm_aggregate_new

On Thursday, 21 December 2023 06:52:01 CET Jinho Ju wrote:
> Resending to everyone on the mailing list as per previous mail, adding some
> things that were missing.
> 
> Regarding the cause of the L2-related crash being detected by syzkaller,

What crash? I can't see it in your mail [1]

> I
> can't say for sure - what I can say for sure at this point is that a
> memleak occurring in L2 was detected by my personal syzkaller.

Nothing tells you that the actual leak happened in layer 2. You only know that 
packets were generated in batman-adv and mac80211_hwsim. But nothing tells you 
what actually lost track of the skbuff (if that even happens).

> Moving away from syzkaller for a moment and shifting the focus to memleak,
> we have to assume that the conditions for this to occur are that they
> reference the same network stack and are found in modules in L2,

What do you mean with "reference the same network stack"?

And no, nothing tells you that the culprit is actually something related to 
network layer 2.

> but it
> seems that when batman-adv is freed and returned while accessing and
> processing a skb in veth (L3),

veth is layer 2.

> memleak occurs because it is trying to
> reference the same skb, the veth freed skb.

This doesn't make a lot of sense. batman-adv is not referencing the skb 
anymore after it was submitted to the underlying device. And if it would 
reference anything then it would not be a memleak.


There are a lot of possibilities:

* kmemleak cannot not handling transient queue state correctly while the 
  namespace is destroyed (because it doesn't have a consistent memory state 
  while it scans)
* removing of the network namespace (used by the reproducers) might leak skbs 
  which are currently passed around between the queues
* there is an actual memory leak somewhere while the queued packets are processed
* ...

The first two option seem plausible to me because you can see "memory leaks" 
in for other things which regularly (and often) transmit packets in this 
namespace. In you log, this would hwsim which transmits beacons regularly (and 
often).

I would guess that you see something similar when you use pktgen.

It would now be interesting if you still see the memory leak if you mark all 
unfreed objects as grey and redo the scan:


   echo clear > /sys/kernel/debug/kmemleak
   echo scan > /sys/kernel/debug/kmemleak

If you would still see it then we could rule out the first option. If not, 
then it is a false positive.

Kind regards,
	Sven

[1] https://lists.open-mesh.org/mailman3/hyperkitty/list/b.a.t.m.a.n@lists.open-mesh.org/thread/GLS6TCIPHIMWF2G6PVDEEK6UDVFB6UD2/
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ