Skip to content

Commit 9ea674d

Browse files
committed
Merge branch 'skb-leak-fixes'
Gal Pressman says: ==================== net: Couple of skb memory leak fixes As discussed in: https://lore.kernel.org/netdev/[email protected]/ 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 <[email protected]>
2 parents c0b7f7d + 79074a7 commit 9ea674d

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

net/core/sock.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2049,6 +2049,9 @@ void sk_destruct(struct sock *sk)
20492049
{
20502050
bool use_call_rcu = sock_flag(sk, SOCK_RCU_FREE);
20512051

2052+
WARN_ON_ONCE(!llist_empty(&sk->defer_list));
2053+
sk_defer_free_flush(sk);
2054+
20522055
if (rcu_access_pointer(sk->sk_reuseport_cb)) {
20532056
reuseport_detach_sock(sk);
20542057
use_call_rcu = true;

net/tls/tls_sw.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2059,6 +2059,7 @@ ssize_t tls_sw_splice_read(struct socket *sock, loff_t *ppos,
20592059

20602060
splice_read_end:
20612061
release_sock(sk);
2062+
sk_defer_free_flush(sk);
20622063
return copied ? : err;
20632064
}
20642065

0 commit comments

Comments
 (0)