]> git.ipfire.org Git - thirdparty/linux.git/commit
af_unix: Use consume_skb() in connect() and sendmsg().
authorKuniyuki Iwashima <kuniyu@amazon.com>
Thu, 16 Jan 2025 05:34:42 +0000 (14:34 +0900)
committerJakub Kicinski <kuba@kernel.org>
Mon, 20 Jan 2025 19:27:42 +0000 (11:27 -0800)
commit085e6cba85ca81fbb4ebfc238c934108f0e8467e
tree0d6f7b476dfa181b6169ce34ba7784c026756d5a
parent3b2d40dc13c26a4efde438beb664576d20a9fb4a
af_unix: Use consume_skb() in connect() and sendmsg().

This is based on Donald Hunter's patch.

These functions could fail for various reasons, sometimes
triggering kfree_skb().

  * unix_stream_connect() : connect()
  * unix_stream_sendmsg() : sendmsg()
  * queue_oob()           : sendmsg(MSG_OOB)
  * unix_dgram_sendmsg()  : sendmsg()

Such kfree_skb() is tied to the errno of connect() and
sendmsg(), and we need not define skb drop reasons.

Let's use consume_skb() not to churn kfree_skb() events.

Link: https://lore.kernel.org/netdev/eb30b164-7f86-46bf-a5d3-0f8bda5e9398@redhat.com/
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://patch.msgid.link/20250116053441.5758-10-kuniyu@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/unix/af_unix.c