mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-01 03:44:27 -04:00
Merge branch 'skb-leak-fixes'
Gal Pressman says: ==================== net: Couple of skb memory leak fixes As discussed in: https://lore.kernel.org/netdev/20220102081253.9123-1-gal@nvidia.com/ These are the two followup suggestions from Eric and Jakub. Patch #1 adds a sk_defer_free_flush() call to the kTLS splice_read handler. Patch #2 verifies the defer list is empty on socket destroy, and calls a defer free flush as well. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -2049,6 +2049,9 @@ void sk_destruct(struct sock *sk)
|
||||
{
|
||||
bool use_call_rcu = sock_flag(sk, SOCK_RCU_FREE);
|
||||
|
||||
WARN_ON_ONCE(!llist_empty(&sk->defer_list));
|
||||
sk_defer_free_flush(sk);
|
||||
|
||||
if (rcu_access_pointer(sk->sk_reuseport_cb)) {
|
||||
reuseport_detach_sock(sk);
|
||||
use_call_rcu = true;
|
||||
|
||||
@@ -2059,6 +2059,7 @@ ssize_t tls_sw_splice_read(struct socket *sock, loff_t *ppos,
|
||||
|
||||
splice_read_end:
|
||||
release_sock(sk);
|
||||
sk_defer_free_flush(sk);
|
||||
return copied ? : err;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user