Merge branch 'fix sockmap + stream af_unix memleak'
authorMartin KaFai Lau <martin.lau@kernel.org>
Thu, 4 Jan 2024 00:34:32 +0000 (16:34 -0800)
committerMartin KaFai Lau <martin.lau@kernel.org>
Thu, 4 Jan 2024 00:50:24 +0000 (16:50 -0800)
John Fastabend says:

====================
There was a memleak when streaming af_unix sockets were inserted into
multiple sockmap slots and/or maps. This is because each insert would
call a proto update operatino and these must be allowed to be called
multiple times. The streaming af_unix implementation recently added
a refcnt to handle a use after free issue, however it introduced a
memleak when inserted into multiple maps.

This series fixes the memleak, adds a note in the code so we remember
that proto updates need to support this. And then we add three tests
for each of the slightly different iterations of adding sockets into
multiple maps. I kept them as 3 independent test cases here. I have
some slight preference for this they could however be a single test,
but then you don't get to run them independently which was sort of
useful while debugging.
====================

Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>

Trivial merge