mbox series

[v5,net,0/2] af_unix: Fix memleak and null-ptr-deref around MSG_OOB and GC.

Message ID 20240515003204.43153-1-kuniyu@amazon.com (mailing list archive)
Headers show
Series af_unix: Fix memleak and null-ptr-deref around MSG_OOB and GC. | expand

Message

Kuniyuki Iwashima May 15, 2024, 12:32 a.m. UTC
The patch 1 fixes memleak caused by SCM_RIGHTS OOB skb sent to embryo
socket, and the patch 2 fixes null-ptr-deref caused by OOB data.


Changes:
  v5:
    * Add patch 1

  v4: https://lore.kernel.org/netdev/20240514025250.12604-1-kuniyu@amazon.com/
    * Free oob skb properly (Simon)

  v3: https://lore.kernel.org/all/20240513130628.33641-1-kuniyu@amazon.com/
    * Fix lockdep false-positive by calling kfree_skb outside of
      recvq lock (Michal)

  v2: https://lore.kernel.org/netdev/20240510093905.25510-1-kuniyu@amazon.com/
    * Add recvq locking everywhere we touch oob_skb (Paolo)

  v1: https://lore.kernel.org/netdev/20240507170018.83385-1-kuniyu@amazon.com/


Kuniyuki Iwashima (1):
  af_unix: Update unix_sk(sk)->oob_skb under sk_receive_queue lock.

Michal Luczaj (1):
  af_unix: Fix garbage collection of embryos carrying OOB/SCM_RIGHTS.

 net/unix/af_unix.c | 28 ++++++++++++++++++++++------
 net/unix/garbage.c | 21 +++++++++++----------
 2 files changed, 33 insertions(+), 16 deletions(-)