]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
Merge branch 'af_unix-fix-lockless-access-of-sk-sk_state-and-others-fields'
authorPaolo Abeni <pabeni@redhat.com>
Thu, 6 Jun 2024 10:57:17 +0000 (12:57 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 6 Jun 2024 10:57:18 +0000 (12:57 +0200)
commit411c0ea696cc4fcd14a32f2093c909e0c59c5dd7
tree42ca942ab931b6967d93e9183b4712b902993697
parentb0c9a26435413b81799047a7be53255640432547
parentefaf24e30ec39ebbea9112227485805a48b0ceb1
Merge branch 'af_unix-fix-lockless-access-of-sk-sk_state-and-others-fields'

Kuniyuki Iwashima says:

====================
af_unix: Fix lockless access of sk->sk_state and others fields.

The patch 1 fixes a bug where SOCK_DGRAM's sk->sk_state is changed
to TCP_CLOSE even if the socket is connect()ed to another socket.

The rest of this series annotates lockless accesses to the following
fields.

  * sk->sk_state
  * sk->sk_sndbuf
  * net->unx.sysctl_max_dgram_qlen
  * sk->sk_receive_queue.qlen
  * sk->sk_shutdown

Note that with this series there is skb_queue_empty() left in
unix_dgram_disconnected() that needs to be changed to lockless
version, and unix_peer(other) access there should be protected
by unix_state_lock().

This will require some refactoring, so another series will follow.

Changes:
  v2:
    * Patch 1: Fix wrong double lock

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

Link: https://lore.kernel.org/r/20240604165241.44758-1-kuniyu@amazon.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>