Skip to content
Commit 820ed3fb authored by John Fastabend's avatar John Fastabend Committed by Daniel Borkmann
Browse files

bpf: sockmap, free memory on sock close with cork data



If a socket with pending cork data is closed we do not return the
memory to the socket until the garbage collector free's the psock
structure. The garbage collector though can run after the sock has
completed its close operation. If this ordering happens the sock code
will through a WARN_ON because there is still outstanding memory
accounted to the sock.

To resolve this ensure we return memory to the sock when a socket
is closed.

Signed-off-by: default avatarJohn Fastabend <john.fastabend@gmail.com>
Fixes: 91843d54 ("bpf: sockmap, add msg_cork_bytes() helper")
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parent 4608f064
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment