Re: Fwd: Fwd: memory leak in batadv_iv_ogm_aggregate_new

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxx/thread/GLS6TCIPHIMWF2G6PVDEEK6UDVFB6UD2/

Attachment: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux