]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
drop some unneeded 6.6 patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Jun 2024 11:18:08 +0000 (13:18 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Jun 2024 11:18:08 +0000 (13:18 +0200)
queue-6.6/af_unix-annotate-data-race-of-sk-sk_state-in-unix_ac.patch
queue-6.6/af_unix-read-with-msg_peek-loops-if-the-first-unread.patch
queue-6.6/af_unix-replace-bug_on-with-warn_on_once.patch [deleted file]
queue-6.6/af_unix-return-struct-unix_sock-from-unix_get_socket.patch [deleted file]
queue-6.6/af_unix-run-gc-on-only-one-cpu.patch [deleted file]
queue-6.6/af_unix-save-listener-for-embryo-socket.patch [deleted file]
queue-6.6/af_unix-try-to-run-gc-async.patch [deleted file]
queue-6.6/net-change-proto-and-proto_ops-accept-type.patch [deleted file]
queue-6.6/series

index 93a4dbda12ca9c1294b14e8b36e0cca6792ccbd8..be70ddcfedc72ffbb0328c9bb305fab54b6c1bf5 100644 (file)
@@ -19,22 +19,17 @@ Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
 Signed-off-by: Paolo Abeni <pabeni@redhat.com>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
 ---
- net/unix/af_unix.c | 2 +-
+ net/unix/af_unix.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
-index ab57fa0595e21..5fb705ce15ea5 100644
 --- a/net/unix/af_unix.c
 +++ b/net/unix/af_unix.c
-@@ -1711,7 +1711,7 @@ static int unix_accept(struct socket *sock, struct socket *newsock,
+@@ -1710,7 +1710,7 @@ static int unix_accept(struct socket *so
                goto out;
  
-       arg->err = -EINVAL;
+       err = -EINVAL;
 -      if (sk->sk_state != TCP_LISTEN)
 +      if (READ_ONCE(sk->sk_state) != TCP_LISTEN)
                goto out;
  
        /* If socket state is TCP_LISTEN it cannot change (for now...),
--- 
-2.43.0
-
index 93fabc301335e615fcbb459f8175c2417895c491..c4c29b743df2cb5052d1de50cf6e2dd426d5cf88 100644 (file)
@@ -45,14 +45,12 @@ Link: https://lore.kernel.org/r/20240611084639.2248934-1-Rao.Shoaib@oracle.com
 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
 ---
- net/unix/af_unix.c | 18 +++++++++---------
+ net/unix/af_unix.c |   18 +++++++++---------
  1 file changed, 9 insertions(+), 9 deletions(-)
 
-diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
-index 5fb705ce15ea5..5ec188209bdd5 100644
 --- a/net/unix/af_unix.c
 +++ b/net/unix/af_unix.c
-@@ -2600,18 +2600,18 @@ static struct sk_buff *manage_oob(struct sk_buff *skb, struct sock *sk,
+@@ -2596,18 +2596,18 @@ static struct sk_buff *manage_oob(struct
                if (skb == u->oob_skb) {
                        if (copied) {
                                skb = NULL;
@@ -80,6 +78,3 @@ index 5fb705ce15ea5..5ec188209bdd5 100644
                        }
                }
  
--- 
-2.43.0
-
diff --git a/queue-6.6/af_unix-replace-bug_on-with-warn_on_once.patch b/queue-6.6/af_unix-replace-bug_on-with-warn_on_once.patch
deleted file mode 100644 (file)
index 4f43257..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-From 17c0bc83b42a1e9feef661539a4ad1e1c09dd936 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 29 Jan 2024 11:04:33 -0800
-Subject: af_unix: Replace BUG_ON() with WARN_ON_ONCE().
-
-From: Kuniyuki Iwashima <kuniyu@amazon.com>
-
-[ Upstream commit d0f6dc26346863e1f4a23117f5468614e54df064 ]
-
-This is a prep patch for the last patch in this series so that
-checkpatch will not warn about BUG_ON().
-
-Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
-Acked-by: Jens Axboe <axboe@kernel.dk>
-Link: https://lore.kernel.org/r/20240129190435.57228-2-kuniyu@amazon.com
-Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-Stable-dep-of: 1b536948e805 ("af_unix: Annotate data-race of sk->sk_state in unix_accept().")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- net/unix/garbage.c | 8 ++++----
- net/unix/scm.c     | 8 ++++----
- 2 files changed, 8 insertions(+), 8 deletions(-)
-
-diff --git a/net/unix/garbage.c b/net/unix/garbage.c
-index 96cc6b7674333..b4bf7f7538826 100644
---- a/net/unix/garbage.c
-+++ b/net/unix/garbage.c
-@@ -145,7 +145,7 @@ static void scan_children(struct sock *x, void (*func)(struct unix_sock *),
-                       /* An embryo cannot be in-flight, so it's safe
-                        * to use the list link.
-                        */
--                      BUG_ON(!list_empty(&u->link));
-+                      WARN_ON_ONCE(!list_empty(&u->link));
-                       list_add_tail(&u->link, &embryos);
-               }
-               spin_unlock(&x->sk_receive_queue.lock);
-@@ -224,8 +224,8 @@ static void __unix_gc(struct work_struct *work)
-               total_refs = file_count(sk->sk_socket->file);
--              BUG_ON(!u->inflight);
--              BUG_ON(total_refs < u->inflight);
-+              WARN_ON_ONCE(!u->inflight);
-+              WARN_ON_ONCE(total_refs < u->inflight);
-               if (total_refs == u->inflight) {
-                       list_move_tail(&u->link, &gc_candidates);
-                       __set_bit(UNIX_GC_CANDIDATE, &u->gc_flags);
-@@ -318,7 +318,7 @@ static void __unix_gc(struct work_struct *work)
-               list_move_tail(&u->link, &gc_inflight_list);
-       /* All candidates should have been detached by now. */
--      BUG_ON(!list_empty(&gc_candidates));
-+      WARN_ON_ONCE(!list_empty(&gc_candidates));
-       /* Paired with READ_ONCE() in wait_for_unix_gc(). */
-       WRITE_ONCE(gc_in_progress, false);
-diff --git a/net/unix/scm.c b/net/unix/scm.c
-index b5ae5ab167773..505e56cf02a21 100644
---- a/net/unix/scm.c
-+++ b/net/unix/scm.c
-@@ -51,10 +51,10 @@ void unix_inflight(struct user_struct *user, struct file *fp)
-       if (u) {
-               if (!u->inflight) {
--                      BUG_ON(!list_empty(&u->link));
-+                      WARN_ON_ONCE(!list_empty(&u->link));
-                       list_add_tail(&u->link, &gc_inflight_list);
-               } else {
--                      BUG_ON(list_empty(&u->link));
-+                      WARN_ON_ONCE(list_empty(&u->link));
-               }
-               u->inflight++;
-               /* Paired with READ_ONCE() in wait_for_unix_gc() */
-@@ -71,8 +71,8 @@ void unix_notinflight(struct user_struct *user, struct file *fp)
-       spin_lock(&unix_gc_lock);
-       if (u) {
--              BUG_ON(!u->inflight);
--              BUG_ON(list_empty(&u->link));
-+              WARN_ON_ONCE(!u->inflight);
-+              WARN_ON_ONCE(list_empty(&u->link));
-               u->inflight--;
-               if (!u->inflight)
--- 
-2.43.0
-
diff --git a/queue-6.6/af_unix-return-struct-unix_sock-from-unix_get_socket.patch b/queue-6.6/af_unix-return-struct-unix_sock-from-unix_get_socket.patch
deleted file mode 100644 (file)
index 0c95e26..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-From 267ecb9a5c2758115014adbfcc140dfd1dac18e2 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Tue, 23 Jan 2024 09:08:54 -0800
-Subject: af_unix: Return struct unix_sock from unix_get_socket().
-
-From: Kuniyuki Iwashima <kuniyu@amazon.com>
-
-[ Upstream commit 5b17307bd0789edea0675d524a2b277b93bbde62 ]
-
-Currently, unix_get_socket() returns struct sock, but after calling
-it, we always cast it to unix_sk().
-
-Let's return struct unix_sock from unix_get_socket().
-
-Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
-Acked-by: Pavel Begunkov <asml.silence@gmail.com>
-Reviewed-by: Simon Horman <horms@kernel.org>
-Link: https://lore.kernel.org/r/20240123170856.41348-4-kuniyu@amazon.com
-Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-Stable-dep-of: 1b536948e805 ("af_unix: Annotate data-race of sk->sk_state in unix_accept().")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- include/net/af_unix.h |  2 +-
- net/unix/garbage.c    | 19 +++++++------------
- net/unix/scm.c        | 19 +++++++------------
- 3 files changed, 15 insertions(+), 25 deletions(-)
-
-diff --git a/include/net/af_unix.h b/include/net/af_unix.h
-index 77bf30203d3cf..7a00d7ed527b6 100644
---- a/include/net/af_unix.h
-+++ b/include/net/af_unix.h
-@@ -14,7 +14,7 @@ void unix_destruct_scm(struct sk_buff *skb);
- void io_uring_destruct_scm(struct sk_buff *skb);
- void unix_gc(void);
- void wait_for_unix_gc(void);
--struct sock *unix_get_socket(struct file *filp);
-+struct unix_sock *unix_get_socket(struct file *filp);
- struct sock *unix_peer_get(struct sock *sk);
- #define UNIX_HASH_MOD (256 - 1)
-diff --git a/net/unix/garbage.c b/net/unix/garbage.c
-index 2a758531e1027..38639766b9e7c 100644
---- a/net/unix/garbage.c
-+++ b/net/unix/garbage.c
-@@ -105,20 +105,15 @@ static void scan_inflight(struct sock *x, void (*func)(struct unix_sock *),
-                       while (nfd--) {
-                               /* Get the socket the fd matches if it indeed does so */
--                              struct sock *sk = unix_get_socket(*fp++);
-+                              struct unix_sock *u = unix_get_socket(*fp++);
--                              if (sk) {
--                                      struct unix_sock *u = unix_sk(sk);
-+                              /* Ignore non-candidates, they could have been added
-+                               * to the queues after starting the garbage collection
-+                               */
-+                              if (u && test_bit(UNIX_GC_CANDIDATE, &u->gc_flags)) {
-+                                      hit = true;
--                                      /* Ignore non-candidates, they could
--                                       * have been added to the queues after
--                                       * starting the garbage collection
--                                       */
--                                      if (test_bit(UNIX_GC_CANDIDATE, &u->gc_flags)) {
--                                              hit = true;
--
--                                              func(u);
--                                      }
-+                                      func(u);
-                               }
-                       }
-                       if (hit && hitlist != NULL) {
-diff --git a/net/unix/scm.c b/net/unix/scm.c
-index e92f2fad64105..b5ae5ab167773 100644
---- a/net/unix/scm.c
-+++ b/net/unix/scm.c
-@@ -21,9 +21,8 @@ EXPORT_SYMBOL(gc_inflight_list);
- DEFINE_SPINLOCK(unix_gc_lock);
- EXPORT_SYMBOL(unix_gc_lock);
--struct sock *unix_get_socket(struct file *filp)
-+struct unix_sock *unix_get_socket(struct file *filp)
- {
--      struct sock *u_sock = NULL;
-       struct inode *inode = file_inode(filp);
-       /* Socket ? */
-@@ -34,10 +33,10 @@ struct sock *unix_get_socket(struct file *filp)
-               /* PF_UNIX ? */
-               if (s && ops && ops->family == PF_UNIX)
--                      u_sock = s;
-+                      return unix_sk(s);
-       }
--      return u_sock;
-+      return NULL;
- }
- EXPORT_SYMBOL(unix_get_socket);
-@@ -46,13 +45,11 @@ EXPORT_SYMBOL(unix_get_socket);
-  */
- void unix_inflight(struct user_struct *user, struct file *fp)
- {
--      struct sock *s = unix_get_socket(fp);
-+      struct unix_sock *u = unix_get_socket(fp);
-       spin_lock(&unix_gc_lock);
--      if (s) {
--              struct unix_sock *u = unix_sk(s);
--
-+      if (u) {
-               if (!u->inflight) {
-                       BUG_ON(!list_empty(&u->link));
-                       list_add_tail(&u->link, &gc_inflight_list);
-@@ -69,13 +66,11 @@ void unix_inflight(struct user_struct *user, struct file *fp)
- void unix_notinflight(struct user_struct *user, struct file *fp)
- {
--      struct sock *s = unix_get_socket(fp);
-+      struct unix_sock *u = unix_get_socket(fp);
-       spin_lock(&unix_gc_lock);
--      if (s) {
--              struct unix_sock *u = unix_sk(s);
--
-+      if (u) {
-               BUG_ON(!u->inflight);
-               BUG_ON(list_empty(&u->link));
--- 
-2.43.0
-
diff --git a/queue-6.6/af_unix-run-gc-on-only-one-cpu.patch b/queue-6.6/af_unix-run-gc-on-only-one-cpu.patch
deleted file mode 100644 (file)
index b9fc302..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-From 98ec559b1b6f1e877ae9fa39c646ecfcdc6d6342 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Tue, 23 Jan 2024 09:08:55 -0800
-Subject: af_unix: Run GC on only one CPU.
-
-From: Kuniyuki Iwashima <kuniyu@amazon.com>
-
-[ Upstream commit 8b90a9f819dc2a06baae4ec1a64d875e53b824ec ]
-
-If more than 16000 inflight AF_UNIX sockets exist and the garbage
-collector is not running, unix_(dgram|stream)_sendmsg() call unix_gc().
-Also, they wait for unix_gc() to complete.
-
-In unix_gc(), all inflight AF_UNIX sockets are traversed at least once,
-and more if they are the GC candidate.  Thus, sendmsg() significantly
-slows down with too many inflight AF_UNIX sockets.
-
-There is a small window to invoke multiple unix_gc() instances, which
-will then be blocked by the same spinlock except for one.
-
-Let's convert unix_gc() to use struct work so that it will not consume
-CPUs unnecessarily.
-
-Note WRITE_ONCE(gc_in_progress, true) is moved before running GC.
-If we leave the WRITE_ONCE() as is and use the following test to
-call flush_work(), a process might not call it.
-
-    CPU 0                                     CPU 1
-    ---                                       ---
-                                              start work and call __unix_gc()
-    if (work_pending(&unix_gc_work) ||        <-- false
-        READ_ONCE(gc_in_progress))            <-- false
-            flush_work();                     <-- missed!
-                                             WRITE_ONCE(gc_in_progress, true)
-
-Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
-Link: https://lore.kernel.org/r/20240123170856.41348-5-kuniyu@amazon.com
-Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-Stable-dep-of: 1b536948e805 ("af_unix: Annotate data-race of sk->sk_state in unix_accept().")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- net/unix/garbage.c | 54 +++++++++++++++++++++++-----------------------
- 1 file changed, 27 insertions(+), 27 deletions(-)
-
-diff --git a/net/unix/garbage.c b/net/unix/garbage.c
-index 38639766b9e7c..a2a8543613a52 100644
---- a/net/unix/garbage.c
-+++ b/net/unix/garbage.c
-@@ -86,7 +86,6 @@
- /* Internal data structures and random procedures: */
- static LIST_HEAD(gc_candidates);
--static DECLARE_WAIT_QUEUE_HEAD(unix_gc_wait);
- static void scan_inflight(struct sock *x, void (*func)(struct unix_sock *),
-                         struct sk_buff_head *hitlist)
-@@ -182,23 +181,8 @@ static void inc_inflight_move_tail(struct unix_sock *u)
- }
- static bool gc_in_progress;
--#define UNIX_INFLIGHT_TRIGGER_GC 16000
--
--void wait_for_unix_gc(void)
--{
--      /* If number of inflight sockets is insane,
--       * force a garbage collect right now.
--       * Paired with the WRITE_ONCE() in unix_inflight(),
--       * unix_notinflight() and gc_in_progress().
--       */
--      if (READ_ONCE(unix_tot_inflight) > UNIX_INFLIGHT_TRIGGER_GC &&
--          !READ_ONCE(gc_in_progress))
--              unix_gc();
--      wait_event(unix_gc_wait, !READ_ONCE(gc_in_progress));
--}
--/* The external entry point: unix_gc() */
--void unix_gc(void)
-+static void __unix_gc(struct work_struct *work)
- {
-       struct sk_buff *next_skb, *skb;
-       struct unix_sock *u;
-@@ -209,13 +193,6 @@ void unix_gc(void)
-       spin_lock(&unix_gc_lock);
--      /* Avoid a recursive GC. */
--      if (gc_in_progress)
--              goto out;
--
--      /* Paired with READ_ONCE() in wait_for_unix_gc(). */
--      WRITE_ONCE(gc_in_progress, true);
--
-       /* First, select candidates for garbage collection.  Only
-        * in-flight sockets are considered, and from those only ones
-        * which don't have any external reference.
-@@ -346,8 +323,31 @@ void unix_gc(void)
-       /* Paired with READ_ONCE() in wait_for_unix_gc(). */
-       WRITE_ONCE(gc_in_progress, false);
--      wake_up(&unix_gc_wait);
--
-- out:
-       spin_unlock(&unix_gc_lock);
- }
-+
-+static DECLARE_WORK(unix_gc_work, __unix_gc);
-+
-+void unix_gc(void)
-+{
-+      WRITE_ONCE(gc_in_progress, true);
-+      queue_work(system_unbound_wq, &unix_gc_work);
-+}
-+
-+#define UNIX_INFLIGHT_TRIGGER_GC 16000
-+
-+void wait_for_unix_gc(void)
-+{
-+      /* If number of inflight sockets is insane,
-+       * force a garbage collect right now.
-+       *
-+       * Paired with the WRITE_ONCE() in unix_inflight(),
-+       * unix_notinflight(), and __unix_gc().
-+       */
-+      if (READ_ONCE(unix_tot_inflight) > UNIX_INFLIGHT_TRIGGER_GC &&
-+          !READ_ONCE(gc_in_progress))
-+              unix_gc();
-+
-+      if (READ_ONCE(gc_in_progress))
-+              flush_work(&unix_gc_work);
-+}
--- 
-2.43.0
-
diff --git a/queue-6.6/af_unix-save-listener-for-embryo-socket.patch b/queue-6.6/af_unix-save-listener-for-embryo-socket.patch
deleted file mode 100644 (file)
index 894da4f..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-From 85705757f4b5b569af40f4a66f9a4308ea950651 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 25 Mar 2024 13:24:17 -0700
-Subject: af_unix: Save listener for embryo socket.
-
-From: Kuniyuki Iwashima <kuniyu@amazon.com>
-
-[ Upstream commit aed6ecef55d70de3762ce41c561b7f547dbaf107 ]
-
-This is a prep patch for the following change, where we need to
-fetch the listening socket from the successor embryo socket
-during GC.
-
-We add a new field to struct unix_sock to save a pointer to a
-listening socket.
-
-We set it when connect() creates a new socket, and clear it when
-accept() is called.
-
-Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
-Acked-by: Paolo Abeni <pabeni@redhat.com>
-Link: https://lore.kernel.org/r/20240325202425.60930-8-kuniyu@amazon.com
-Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-Stable-dep-of: 1b536948e805 ("af_unix: Annotate data-race of sk->sk_state in unix_accept().")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- include/net/af_unix.h | 1 +
- net/unix/af_unix.c    | 5 ++++-
- 2 files changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/include/net/af_unix.h b/include/net/af_unix.h
-index 865e2f7bd67cf..1aa30778d2c05 100644
---- a/include/net/af_unix.h
-+++ b/include/net/af_unix.h
-@@ -62,6 +62,7 @@ struct unix_sock {
-       struct path             path;
-       struct mutex            iolock, bindlock;
-       struct sock             *peer;
-+      struct sock             *listener;
-       struct list_head        link;
-       unsigned long           inflight;
-       spinlock_t              lock;
-diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
-index 868f5332566c7..9d48eef5d62e3 100644
---- a/net/unix/af_unix.c
-+++ b/net/unix/af_unix.c
-@@ -987,6 +987,7 @@ static struct sock *unix_create1(struct net *net, struct socket *sock, int kern,
-       sk->sk_max_ack_backlog  = READ_ONCE(net->unx.sysctl_max_dgram_qlen);
-       sk->sk_destruct         = unix_sock_destructor;
-       u = unix_sk(sk);
-+      u->listener = NULL;
-       u->inflight = 0;
-       u->path.dentry = NULL;
-       u->path.mnt = NULL;
-@@ -1606,6 +1607,7 @@ static int unix_stream_connect(struct socket *sock, struct sockaddr *uaddr,
-       newsk->sk_type          = sk->sk_type;
-       init_peercred(newsk);
-       newu = unix_sk(newsk);
-+      newu->listener = other;
-       RCU_INIT_POINTER(newsk->sk_wq, &newu->peer_wq);
-       otheru = unix_sk(other);
-@@ -1701,8 +1703,8 @@ static int unix_accept(struct socket *sock, struct socket *newsock, int flags,
-                      bool kern)
- {
-       struct sock *sk = sock->sk;
--      struct sock *tsk;
-       struct sk_buff *skb;
-+      struct sock *tsk;
-       int err;
-       err = -EOPNOTSUPP;
-@@ -1727,6 +1729,7 @@ static int unix_accept(struct socket *sock, struct socket *newsock, int flags,
-       }
-       tsk = skb->sk;
-+      unix_sk(tsk)->listener = NULL;
-       skb_free_datagram(sk, skb);
-       wake_up_interruptible(&unix_sk(sk)->peer_wait);
--- 
-2.43.0
-
diff --git a/queue-6.6/af_unix-try-to-run-gc-async.patch b/queue-6.6/af_unix-try-to-run-gc-async.patch
deleted file mode 100644 (file)
index 0d4609d..0000000
+++ /dev/null
@@ -1,210 +0,0 @@
-From 6f82fb6e3831ba0424dd146e087553b9bfbe294b Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Tue, 23 Jan 2024 09:08:56 -0800
-Subject: af_unix: Try to run GC async.
-
-From: Kuniyuki Iwashima <kuniyu@amazon.com>
-
-[ Upstream commit d9f21b3613337b55cc9d4a6ead484dca68475143 ]
-
-If more than 16000 inflight AF_UNIX sockets exist and the garbage
-collector is not running, unix_(dgram|stream)_sendmsg() call unix_gc().
-Also, they wait for unix_gc() to complete.
-
-In unix_gc(), all inflight AF_UNIX sockets are traversed at least once,
-and more if they are the GC candidate.  Thus, sendmsg() significantly
-slows down with too many inflight AF_UNIX sockets.
-
-However, if a process sends data with no AF_UNIX FD, the sendmsg() call
-does not need to wait for GC.  After this change, only the process that
-meets the condition below will be blocked under such a situation.
-
-  1) cmsg contains AF_UNIX socket
-  2) more than 32 AF_UNIX sent by the same user are still inflight
-
-Note that even a sendmsg() call that does not meet the condition but has
-AF_UNIX FD will be blocked later in unix_scm_to_skb() by the spinlock,
-but we allow that as a bonus for sane users.
-
-The results below are the time spent in unix_dgram_sendmsg() sending 1
-byte of data with no FD 4096 times on a host where 32K inflight AF_UNIX
-sockets exist.
-
-Without series: the sane sendmsg() needs to wait gc unreasonably.
-
-  $ sudo /usr/share/bcc/tools/funclatency -p 11165 unix_dgram_sendmsg
-  Tracing 1 functions for "unix_dgram_sendmsg"... Hit Ctrl-C to end.
-  ^C
-       nsecs               : count     distribution
-  [...]
-      524288 -> 1048575    : 0        |                                        |
-     1048576 -> 2097151    : 3881     |****************************************|
-     2097152 -> 4194303    : 214      |**                                      |
-     4194304 -> 8388607    : 1        |                                        |
-
-  avg = 1825567 nsecs, total: 7477526027 nsecs, count: 4096
-
-With series: the sane sendmsg() can finish much faster.
-
-  $ sudo /usr/share/bcc/tools/funclatency -p 8702  unix_dgram_sendmsg
-  Tracing 1 functions for "unix_dgram_sendmsg"... Hit Ctrl-C to end.
-  ^C
-       nsecs               : count     distribution
-  [...]
-         128 -> 255        : 0        |                                        |
-         256 -> 511        : 4092     |****************************************|
-         512 -> 1023       : 2        |                                        |
-        1024 -> 2047       : 0        |                                        |
-        2048 -> 4095       : 0        |                                        |
-        4096 -> 8191       : 1        |                                        |
-        8192 -> 16383      : 1        |                                        |
-
-  avg = 410 nsecs, total: 1680510 nsecs, count: 4096
-
-Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
-Link: https://lore.kernel.org/r/20240123170856.41348-6-kuniyu@amazon.com
-Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-Stable-dep-of: 1b536948e805 ("af_unix: Annotate data-race of sk->sk_state in unix_accept().")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- include/net/af_unix.h | 12 ++++++++++--
- include/net/scm.h     |  1 +
- net/core/scm.c        |  5 +++++
- net/unix/af_unix.c    |  6 ++++--
- net/unix/garbage.c    | 10 +++++++++-
- 5 files changed, 29 insertions(+), 5 deletions(-)
-
-diff --git a/include/net/af_unix.h b/include/net/af_unix.h
-index 7a00d7ed527b6..865e2f7bd67cf 100644
---- a/include/net/af_unix.h
-+++ b/include/net/af_unix.h
-@@ -8,13 +8,21 @@
- #include <linux/refcount.h>
- #include <net/sock.h>
-+#if IS_ENABLED(CONFIG_UNIX)
-+struct unix_sock *unix_get_socket(struct file *filp);
-+#else
-+static inline struct unix_sock *unix_get_socket(struct file *filp)
-+{
-+      return NULL;
-+}
-+#endif
-+
- void unix_inflight(struct user_struct *user, struct file *fp);
- void unix_notinflight(struct user_struct *user, struct file *fp);
- void unix_destruct_scm(struct sk_buff *skb);
- void io_uring_destruct_scm(struct sk_buff *skb);
- void unix_gc(void);
--void wait_for_unix_gc(void);
--struct unix_sock *unix_get_socket(struct file *filp);
-+void wait_for_unix_gc(struct scm_fp_list *fpl);
- struct sock *unix_peer_get(struct sock *sk);
- #define UNIX_HASH_MOD (256 - 1)
-diff --git a/include/net/scm.h b/include/net/scm.h
-index e8c76b4be2fe7..1ff6a28550644 100644
---- a/include/net/scm.h
-+++ b/include/net/scm.h
-@@ -24,6 +24,7 @@ struct scm_creds {
- struct scm_fp_list {
-       short                   count;
-+      short                   count_unix;
-       short                   max;
-       struct user_struct      *user;
-       struct file             *fp[SCM_MAX_FD];
-diff --git a/net/core/scm.c b/net/core/scm.c
-index 737917c7ac627..574607b1c2d96 100644
---- a/net/core/scm.c
-+++ b/net/core/scm.c
-@@ -36,6 +36,7 @@
- #include <net/compat.h>
- #include <net/scm.h>
- #include <net/cls_cgroup.h>
-+#include <net/af_unix.h>
- /*
-@@ -85,6 +86,7 @@ static int scm_fp_copy(struct cmsghdr *cmsg, struct scm_fp_list **fplp)
-                       return -ENOMEM;
-               *fplp = fpl;
-               fpl->count = 0;
-+              fpl->count_unix = 0;
-               fpl->max = SCM_MAX_FD;
-               fpl->user = NULL;
-       }
-@@ -109,6 +111,9 @@ static int scm_fp_copy(struct cmsghdr *cmsg, struct scm_fp_list **fplp)
-                       fput(file);
-                       return -EINVAL;
-               }
-+              if (unix_get_socket(file))
-+                      fpl->count_unix++;
-+
-               *fpp++ = file;
-               fpl->count++;
-       }
-diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
-index e6395647558af..868f5332566c7 100644
---- a/net/unix/af_unix.c
-+++ b/net/unix/af_unix.c
-@@ -1908,11 +1908,12 @@ static int unix_dgram_sendmsg(struct socket *sock, struct msghdr *msg,
-       long timeo;
-       int err;
--      wait_for_unix_gc();
-       err = scm_send(sock, msg, &scm, false);
-       if (err < 0)
-               return err;
-+      wait_for_unix_gc(scm.fp);
-+
-       err = -EOPNOTSUPP;
-       if (msg->msg_flags&MSG_OOB)
-               goto out;
-@@ -2180,11 +2181,12 @@ static int unix_stream_sendmsg(struct socket *sock, struct msghdr *msg,
-       bool fds_sent = false;
-       int data_len;
--      wait_for_unix_gc();
-       err = scm_send(sock, msg, &scm, false);
-       if (err < 0)
-               return err;
-+      wait_for_unix_gc(scm.fp);
-+
-       err = -EOPNOTSUPP;
-       if (msg->msg_flags & MSG_OOB) {
- #if IS_ENABLED(CONFIG_AF_UNIX_OOB)
-diff --git a/net/unix/garbage.c b/net/unix/garbage.c
-index a2a8543613a52..96cc6b7674333 100644
---- a/net/unix/garbage.c
-+++ b/net/unix/garbage.c
-@@ -335,8 +335,9 @@ void unix_gc(void)
- }
- #define UNIX_INFLIGHT_TRIGGER_GC 16000
-+#define UNIX_INFLIGHT_SANE_USER (SCM_MAX_FD * 8)
--void wait_for_unix_gc(void)
-+void wait_for_unix_gc(struct scm_fp_list *fpl)
- {
-       /* If number of inflight sockets is insane,
-        * force a garbage collect right now.
-@@ -348,6 +349,13 @@ void wait_for_unix_gc(void)
-           !READ_ONCE(gc_in_progress))
-               unix_gc();
-+      /* Penalise users who want to send AF_UNIX sockets
-+       * but whose sockets have not been received yet.
-+       */
-+      if (!fpl || !fpl->count_unix ||
-+          READ_ONCE(fpl->user->unix_inflight) < UNIX_INFLIGHT_SANE_USER)
-+              return;
-+
-       if (READ_ONCE(gc_in_progress))
-               flush_work(&unix_gc_work);
- }
--- 
-2.43.0
-
diff --git a/queue-6.6/net-change-proto-and-proto_ops-accept-type.patch b/queue-6.6/net-change-proto-and-proto_ops-accept-type.patch
deleted file mode 100644 (file)
index fb9245f..0000000
+++ /dev/null
@@ -1,1026 +0,0 @@
-From 5548e1d39c40fb6c0c0cb4428fa05c9cdff467cf Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Thu, 9 May 2024 09:20:08 -0600
-Subject: net: change proto and proto_ops accept type
-
-From: Jens Axboe <axboe@kernel.dk>
-
-[ Upstream commit 92ef0fd55ac80dfc2e4654edfe5d1ddfa6e070fe ]
-
-Rather than pass in flags, error pointer, and whether this is a kernel
-invocation or not, add a struct proto_accept_arg struct as the argument.
-This then holds all of these arguments, and prepares accept for being
-able to pass back more information.
-
-No functional changes in this patch.
-
-Acked-by: Jakub Kicinski <kuba@kernel.org>
-Signed-off-by: Jens Axboe <axboe@kernel.dk>
-Stable-dep-of: 1b536948e805 ("af_unix: Annotate data-race of sk->sk_state in unix_accept().")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- crypto/af_alg.c                    | 11 ++++++-----
- crypto/algif_hash.c                | 10 +++++-----
- drivers/xen/pvcalls-back.c         |  6 +++++-
- fs/ocfs2/cluster/tcp.c             |  5 ++++-
- include/crypto/if_alg.h            |  3 ++-
- include/linux/net.h                |  4 +++-
- include/net/inet_common.h          |  4 ++--
- include/net/inet_connection_sock.h |  2 +-
- include/net/sock.h                 | 12 +++++++++---
- net/atm/svc.c                      |  8 ++++----
- net/ax25/af_ax25.c                 |  6 +++---
- net/bluetooth/iso.c                |  4 ++--
- net/bluetooth/l2cap_sock.c         |  4 ++--
- net/bluetooth/rfcomm/sock.c        |  6 +++---
- net/bluetooth/sco.c                |  4 ++--
- net/core/sock.c                    |  4 ++--
- net/ipv4/af_inet.c                 | 10 +++++-----
- net/ipv4/inet_connection_sock.c    |  6 +++---
- net/iucv/af_iucv.c                 |  4 ++--
- net/llc/af_llc.c                   |  7 +++----
- net/mptcp/protocol.c               | 11 +++++------
- net/netrom/af_netrom.c             |  6 +++---
- net/nfc/llcp_sock.c                |  4 ++--
- net/phonet/pep.c                   | 12 ++++++------
- net/phonet/socket.c                |  7 +++----
- net/rds/tcp_listen.c               |  6 +++++-
- net/rose/af_rose.c                 |  6 +++---
- net/sctp/socket.c                  |  8 ++++----
- net/smc/af_smc.c                   |  6 +++---
- net/socket.c                       | 13 ++++++++++---
- net/tipc/socket.c                  | 13 +++++--------
- net/unix/af_unix.c                 | 21 ++++++++++-----------
- net/vmw_vsock/af_vsock.c           |  6 +++---
- net/x25/af_x25.c                   |  4 ++--
- 34 files changed, 132 insertions(+), 111 deletions(-)
-
-diff --git a/crypto/af_alg.c b/crypto/af_alg.c
-index 68cc9290cabe9..598bf46691706 100644
---- a/crypto/af_alg.c
-+++ b/crypto/af_alg.c
-@@ -407,7 +407,8 @@ static int alg_setsockopt(struct socket *sock, int level, int optname,
-       return err;
- }
--int af_alg_accept(struct sock *sk, struct socket *newsock, bool kern)
-+int af_alg_accept(struct sock *sk, struct socket *newsock,
-+                struct proto_accept_arg *arg)
- {
-       struct alg_sock *ask = alg_sk(sk);
-       const struct af_alg_type *type;
-@@ -422,7 +423,7 @@ int af_alg_accept(struct sock *sk, struct socket *newsock, bool kern)
-       if (!type)
-               goto unlock;
--      sk2 = sk_alloc(sock_net(sk), PF_ALG, GFP_KERNEL, &alg_proto, kern);
-+      sk2 = sk_alloc(sock_net(sk), PF_ALG, GFP_KERNEL, &alg_proto, arg->kern);
-       err = -ENOMEM;
-       if (!sk2)
-               goto unlock;
-@@ -468,10 +469,10 @@ int af_alg_accept(struct sock *sk, struct socket *newsock, bool kern)
- }
- EXPORT_SYMBOL_GPL(af_alg_accept);
--static int alg_accept(struct socket *sock, struct socket *newsock, int flags,
--                    bool kern)
-+static int alg_accept(struct socket *sock, struct socket *newsock,
-+                    struct proto_accept_arg *arg)
- {
--      return af_alg_accept(sock->sk, newsock, kern);
-+      return af_alg_accept(sock->sk, newsock, arg);
- }
- static const struct proto_ops alg_proto_ops = {
-diff --git a/crypto/algif_hash.c b/crypto/algif_hash.c
-index e24c829d7a015..7c7394d46a235 100644
---- a/crypto/algif_hash.c
-+++ b/crypto/algif_hash.c
-@@ -223,8 +223,8 @@ static int hash_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
-       return err ?: len;
- }
--static int hash_accept(struct socket *sock, struct socket *newsock, int flags,
--                     bool kern)
-+static int hash_accept(struct socket *sock, struct socket *newsock,
-+                     struct proto_accept_arg *arg)
- {
-       struct sock *sk = sock->sk;
-       struct alg_sock *ask = alg_sk(sk);
-@@ -252,7 +252,7 @@ static int hash_accept(struct socket *sock, struct socket *newsock, int flags,
-       if (err)
-               goto out_free_state;
--      err = af_alg_accept(ask->parent, newsock, kern);
-+      err = af_alg_accept(ask->parent, newsock, arg);
-       if (err)
-               goto out_free_state;
-@@ -355,7 +355,7 @@ static int hash_recvmsg_nokey(struct socket *sock, struct msghdr *msg,
- }
- static int hash_accept_nokey(struct socket *sock, struct socket *newsock,
--                           int flags, bool kern)
-+                           struct proto_accept_arg *arg)
- {
-       int err;
-@@ -363,7 +363,7 @@ static int hash_accept_nokey(struct socket *sock, struct socket *newsock,
-       if (err)
-               return err;
--      return hash_accept(sock, newsock, flags, kern);
-+      return hash_accept(sock, newsock, arg);
- }
- static struct proto_ops algif_hash_ops_nokey = {
-diff --git a/drivers/xen/pvcalls-back.c b/drivers/xen/pvcalls-back.c
-index d52593466a792..fd7ed65e0197d 100644
---- a/drivers/xen/pvcalls-back.c
-+++ b/drivers/xen/pvcalls-back.c
-@@ -517,6 +517,10 @@ static void __pvcalls_back_accept(struct work_struct *work)
- {
-       struct sockpass_mapping *mappass = container_of(
-               work, struct sockpass_mapping, register_work);
-+      struct proto_accept_arg arg = {
-+              .flags = O_NONBLOCK,
-+              .kern = true,
-+      };
-       struct sock_mapping *map;
-       struct pvcalls_ioworker *iow;
-       struct pvcalls_fedata *fedata;
-@@ -548,7 +552,7 @@ static void __pvcalls_back_accept(struct work_struct *work)
-       sock->type = mappass->sock->type;
-       sock->ops = mappass->sock->ops;
--      ret = inet_accept(mappass->sock, sock, O_NONBLOCK, true);
-+      ret = inet_accept(mappass->sock, sock, &arg);
-       if (ret == -EAGAIN) {
-               sock_release(sock);
-               return;
-diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c
-index 960080753d3bd..2b8fa3e782fb6 100644
---- a/fs/ocfs2/cluster/tcp.c
-+++ b/fs/ocfs2/cluster/tcp.c
-@@ -1784,6 +1784,9 @@ static int o2net_accept_one(struct socket *sock, int *more)
-       struct o2nm_node *node = NULL;
-       struct o2nm_node *local_node = NULL;
-       struct o2net_sock_container *sc = NULL;
-+      struct proto_accept_arg arg = {
-+              .flags = O_NONBLOCK,
-+      };
-       struct o2net_node *nn;
-       unsigned int nofs_flag;
-@@ -1802,7 +1805,7 @@ static int o2net_accept_one(struct socket *sock, int *more)
-       new_sock->type = sock->type;
-       new_sock->ops = sock->ops;
--      ret = sock->ops->accept(sock, new_sock, O_NONBLOCK, false);
-+      ret = sock->ops->accept(sock, new_sock, &arg);
-       if (ret < 0)
-               goto out;
-diff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h
-index 08b803a4fcde4..93f868afe6935 100644
---- a/include/crypto/if_alg.h
-+++ b/include/crypto/if_alg.h
-@@ -164,7 +164,8 @@ int af_alg_unregister_type(const struct af_alg_type *type);
- int af_alg_release(struct socket *sock);
- void af_alg_release_parent(struct sock *sk);
--int af_alg_accept(struct sock *sk, struct socket *newsock, bool kern);
-+int af_alg_accept(struct sock *sk, struct socket *newsock,
-+                struct proto_accept_arg *arg);
- void af_alg_free_sg(struct af_alg_sgl *sgl);
-diff --git a/include/linux/net.h b/include/linux/net.h
-index c9b4a63791a45..a764a0f6cc39a 100644
---- a/include/linux/net.h
-+++ b/include/linux/net.h
-@@ -153,6 +153,7 @@ struct sockaddr;
- struct msghdr;
- struct module;
- struct sk_buff;
-+struct proto_accept_arg;
- typedef int (*sk_read_actor_t)(read_descriptor_t *, struct sk_buff *,
-                              unsigned int, size_t);
- typedef int (*skb_read_actor_t)(struct sock *, struct sk_buff *);
-@@ -171,7 +172,8 @@ struct proto_ops {
-       int             (*socketpair)(struct socket *sock1,
-                                     struct socket *sock2);
-       int             (*accept)    (struct socket *sock,
--                                    struct socket *newsock, int flags, bool kern);
-+                                    struct socket *newsock,
-+                                    struct proto_accept_arg *arg);
-       int             (*getname)   (struct socket *sock,
-                                     struct sockaddr *addr,
-                                     int peer);
-diff --git a/include/net/inet_common.h b/include/net/inet_common.h
-index f50a644d87a98..c17a6585d0b0b 100644
---- a/include/net/inet_common.h
-+++ b/include/net/inet_common.h
-@@ -29,8 +29,8 @@ int __inet_stream_connect(struct socket *sock, struct sockaddr *uaddr,
-                         int addr_len, int flags, int is_sendmsg);
- int inet_dgram_connect(struct socket *sock, struct sockaddr *uaddr,
-                      int addr_len, int flags);
--int inet_accept(struct socket *sock, struct socket *newsock, int flags,
--              bool kern);
-+int inet_accept(struct socket *sock, struct socket *newsock,
-+              struct proto_accept_arg *arg);
- void __inet_accept(struct socket *sock, struct socket *newsock,
-                  struct sock *newsk);
- int inet_send_prepare(struct sock *sk);
-diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h
-index 6ecac01115d9c..2d9ecea74f5c1 100644
---- a/include/net/inet_connection_sock.h
-+++ b/include/net/inet_connection_sock.h
-@@ -251,7 +251,7 @@ inet_csk_rto_backoff(const struct inet_connection_sock *icsk,
-         return (unsigned long)min_t(u64, when, max_when);
- }
--struct sock *inet_csk_accept(struct sock *sk, int flags, int *err, bool kern);
-+struct sock *inet_csk_accept(struct sock *sk, struct proto_accept_arg *arg);
- int inet_csk_get_port(struct sock *sk, unsigned short snum);
-diff --git a/include/net/sock.h b/include/net/sock.h
-index 5942b5ff4c786..88f69d39a63f9 100644
---- a/include/net/sock.h
-+++ b/include/net/sock.h
-@@ -1244,6 +1244,12 @@ static inline void sk_prot_clear_nulls(struct sock *sk, int size)
-              size - offsetof(struct sock, sk_node.pprev));
- }
-+struct proto_accept_arg {
-+      int flags;
-+      int err;
-+      bool kern;
-+};
-+
- /* Networking protocol blocks we attach to sockets.
-  * socket layer -> transport layer interface
-  */
-@@ -1258,8 +1264,8 @@ struct proto {
-                                       int addr_len);
-       int                     (*disconnect)(struct sock *sk, int flags);
--      struct sock *           (*accept)(struct sock *sk, int flags, int *err,
--                                        bool kern);
-+      struct sock *           (*accept)(struct sock *sk,
-+                                        struct proto_accept_arg *arg);
-       int                     (*ioctl)(struct sock *sk, int cmd,
-                                        int *karg);
-@@ -1931,7 +1937,7 @@ int sock_cmsg_send(struct sock *sk, struct msghdr *msg,
- int sock_no_bind(struct socket *, struct sockaddr *, int);
- int sock_no_connect(struct socket *, struct sockaddr *, int, int);
- int sock_no_socketpair(struct socket *, struct socket *);
--int sock_no_accept(struct socket *, struct socket *, int, bool);
-+int sock_no_accept(struct socket *, struct socket *, struct proto_accept_arg *);
- int sock_no_getname(struct socket *, struct sockaddr *, int);
- int sock_no_ioctl(struct socket *, unsigned int, unsigned long);
- int sock_no_listen(struct socket *, int);
-diff --git a/net/atm/svc.c b/net/atm/svc.c
-index 36a814f1fbd16..f8137ae693b08 100644
---- a/net/atm/svc.c
-+++ b/net/atm/svc.c
-@@ -324,8 +324,8 @@ static int svc_listen(struct socket *sock, int backlog)
-       return error;
- }
--static int svc_accept(struct socket *sock, struct socket *newsock, int flags,
--                    bool kern)
-+static int svc_accept(struct socket *sock, struct socket *newsock,
-+                    struct proto_accept_arg *arg)
- {
-       struct sock *sk = sock->sk;
-       struct sk_buff *skb;
-@@ -336,7 +336,7 @@ static int svc_accept(struct socket *sock, struct socket *newsock, int flags,
-       lock_sock(sk);
--      error = svc_create(sock_net(sk), newsock, 0, kern);
-+      error = svc_create(sock_net(sk), newsock, 0, arg->kern);
-       if (error)
-               goto out;
-@@ -355,7 +355,7 @@ static int svc_accept(struct socket *sock, struct socket *newsock, int flags,
-                               error = -sk->sk_err;
-                               break;
-                       }
--                      if (flags & O_NONBLOCK) {
-+                      if (arg->flags & O_NONBLOCK) {
-                               error = -EAGAIN;
-                               break;
-                       }
-diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
-index 26a3095bec462..97973c65bd633 100644
---- a/net/ax25/af_ax25.c
-+++ b/net/ax25/af_ax25.c
-@@ -1373,8 +1373,8 @@ static int __must_check ax25_connect(struct socket *sock,
-       return err;
- }
--static int ax25_accept(struct socket *sock, struct socket *newsock, int flags,
--                     bool kern)
-+static int ax25_accept(struct socket *sock, struct socket *newsock,
-+                     struct proto_accept_arg *arg)
- {
-       struct sk_buff *skb;
-       struct sock *newsk;
-@@ -1411,7 +1411,7 @@ static int ax25_accept(struct socket *sock, struct socket *newsock, int flags,
-               if (skb)
-                       break;
--              if (flags & O_NONBLOCK) {
-+              if (arg->flags & O_NONBLOCK) {
-                       err = -EWOULDBLOCK;
-                       break;
-               }
-diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c
-index 05b9edb480f09..41e4ee15e7438 100644
---- a/net/bluetooth/iso.c
-+++ b/net/bluetooth/iso.c
-@@ -1036,7 +1036,7 @@ static int iso_sock_listen(struct socket *sock, int backlog)
- }
- static int iso_sock_accept(struct socket *sock, struct socket *newsock,
--                         int flags, bool kern)
-+                         struct proto_accept_arg *arg)
- {
-       DEFINE_WAIT_FUNC(wait, woken_wake_function);
-       struct sock *sk = sock->sk, *ch;
-@@ -1045,7 +1045,7 @@ static int iso_sock_accept(struct socket *sock, struct socket *newsock,
-       lock_sock(sk);
--      timeo = sock_rcvtimeo(sk, flags & O_NONBLOCK);
-+      timeo = sock_rcvtimeo(sk, arg->flags & O_NONBLOCK);
-       BT_DBG("sk %p timeo %ld", sk, timeo);
-diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
-index 97d0a0f5829a6..0f1c1d7efbc14 100644
---- a/net/bluetooth/l2cap_sock.c
-+++ b/net/bluetooth/l2cap_sock.c
-@@ -326,7 +326,7 @@ static int l2cap_sock_listen(struct socket *sock, int backlog)
- }
- static int l2cap_sock_accept(struct socket *sock, struct socket *newsock,
--                           int flags, bool kern)
-+                           struct proto_accept_arg *arg)
- {
-       DEFINE_WAIT_FUNC(wait, woken_wake_function);
-       struct sock *sk = sock->sk, *nsk;
-@@ -335,7 +335,7 @@ static int l2cap_sock_accept(struct socket *sock, struct socket *newsock,
-       lock_sock_nested(sk, L2CAP_NESTING_PARENT);
--      timeo = sock_rcvtimeo(sk, flags & O_NONBLOCK);
-+      timeo = sock_rcvtimeo(sk, arg->flags & O_NONBLOCK);
-       BT_DBG("sk %p timeo %ld", sk, timeo);
-diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c
-index b54e8a530f55a..515b33796db18 100644
---- a/net/bluetooth/rfcomm/sock.c
-+++ b/net/bluetooth/rfcomm/sock.c
-@@ -468,8 +468,8 @@ static int rfcomm_sock_listen(struct socket *sock, int backlog)
-       return err;
- }
--static int rfcomm_sock_accept(struct socket *sock, struct socket *newsock, int flags,
--                            bool kern)
-+static int rfcomm_sock_accept(struct socket *sock, struct socket *newsock,
-+                            struct proto_accept_arg *arg)
- {
-       DEFINE_WAIT_FUNC(wait, woken_wake_function);
-       struct sock *sk = sock->sk, *nsk;
-@@ -483,7 +483,7 @@ static int rfcomm_sock_accept(struct socket *sock, struct socket *newsock, int f
-               goto done;
-       }
--      timeo = sock_rcvtimeo(sk, flags & O_NONBLOCK);
-+      timeo = sock_rcvtimeo(sk, arg->flags & O_NONBLOCK);
-       BT_DBG("sk %p timeo %ld", sk, timeo);
-diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
-index 3c3650902c839..32f391b6e3a24 100644
---- a/net/bluetooth/sco.c
-+++ b/net/bluetooth/sco.c
-@@ -646,7 +646,7 @@ static int sco_sock_listen(struct socket *sock, int backlog)
- }
- static int sco_sock_accept(struct socket *sock, struct socket *newsock,
--                         int flags, bool kern)
-+                         struct proto_accept_arg *arg)
- {
-       DEFINE_WAIT_FUNC(wait, woken_wake_function);
-       struct sock *sk = sock->sk, *ch;
-@@ -655,7 +655,7 @@ static int sco_sock_accept(struct socket *sock, struct socket *newsock,
-       lock_sock(sk);
--      timeo = sock_rcvtimeo(sk, flags & O_NONBLOCK);
-+      timeo = sock_rcvtimeo(sk, arg->flags & O_NONBLOCK);
-       BT_DBG("sk %p timeo %ld", sk, timeo);
-diff --git a/net/core/sock.c b/net/core/sock.c
-index 7f64a7b95cfb2..b69b2cbceb177 100644
---- a/net/core/sock.c
-+++ b/net/core/sock.c
-@@ -3222,8 +3222,8 @@ int sock_no_socketpair(struct socket *sock1, struct socket *sock2)
- }
- EXPORT_SYMBOL(sock_no_socketpair);
--int sock_no_accept(struct socket *sock, struct socket *newsock, int flags,
--                 bool kern)
-+int sock_no_accept(struct socket *sock, struct socket *newsock,
-+                 struct proto_accept_arg *arg)
- {
-       return -EOPNOTSUPP;
- }
-diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
-index 3feff7f738a48..98c40996096c1 100644
---- a/net/ipv4/af_inet.c
-+++ b/net/ipv4/af_inet.c
-@@ -772,16 +772,16 @@ void __inet_accept(struct socket *sock, struct socket *newsock, struct sock *new
-  *    Accept a pending connection. The TCP layer now gives BSD semantics.
-  */
--int inet_accept(struct socket *sock, struct socket *newsock, int flags,
--              bool kern)
-+int inet_accept(struct socket *sock, struct socket *newsock,
-+              struct proto_accept_arg *arg)
- {
-       struct sock *sk1 = sock->sk, *sk2;
--      int err = -EINVAL;
-       /* IPV6_ADDRFORM can change sk->sk_prot under us. */
--      sk2 = READ_ONCE(sk1->sk_prot)->accept(sk1, flags, &err, kern);
-+      arg->err = -EINVAL;
-+      sk2 = READ_ONCE(sk1->sk_prot)->accept(sk1, arg);
-       if (!sk2)
--              return err;
-+              return arg->err;
-       lock_sock(sk2);
-       __inet_accept(sock, newsock, sk2);
-diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
-index a018981b45142..974996a35d01b 100644
---- a/net/ipv4/inet_connection_sock.c
-+++ b/net/ipv4/inet_connection_sock.c
-@@ -657,7 +657,7 @@ static int inet_csk_wait_for_connect(struct sock *sk, long timeo)
- /*
-  * This will accept the next outstanding connection.
-  */
--struct sock *inet_csk_accept(struct sock *sk, int flags, int *err, bool kern)
-+struct sock *inet_csk_accept(struct sock *sk, struct proto_accept_arg *arg)
- {
-       struct inet_connection_sock *icsk = inet_csk(sk);
-       struct request_sock_queue *queue = &icsk->icsk_accept_queue;
-@@ -676,7 +676,7 @@ struct sock *inet_csk_accept(struct sock *sk, int flags, int *err, bool kern)
-       /* Find already established connection */
-       if (reqsk_queue_empty(queue)) {
--              long timeo = sock_rcvtimeo(sk, flags & O_NONBLOCK);
-+              long timeo = sock_rcvtimeo(sk, arg->flags & O_NONBLOCK);
-               /* If this is a non blocking socket don't sleep */
-               error = -EAGAIN;
-@@ -741,7 +741,7 @@ struct sock *inet_csk_accept(struct sock *sk, int flags, int *err, bool kern)
- out_err:
-       newsk = NULL;
-       req = NULL;
--      *err = error;
-+      arg->err = error;
-       goto out;
- }
- EXPORT_SYMBOL(inet_csk_accept);
-diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
-index 498a0c35b7bb2..f6d7659da156a 100644
---- a/net/iucv/af_iucv.c
-+++ b/net/iucv/af_iucv.c
-@@ -795,7 +795,7 @@ static int iucv_sock_listen(struct socket *sock, int backlog)
- /* Accept a pending connection */
- static int iucv_sock_accept(struct socket *sock, struct socket *newsock,
--                          int flags, bool kern)
-+                          struct proto_accept_arg *arg)
- {
-       DECLARE_WAITQUEUE(wait, current);
-       struct sock *sk = sock->sk, *nsk;
-@@ -809,7 +809,7 @@ static int iucv_sock_accept(struct socket *sock, struct socket *newsock,
-               goto done;
-       }
--      timeo = sock_rcvtimeo(sk, flags & O_NONBLOCK);
-+      timeo = sock_rcvtimeo(sk, arg->flags & O_NONBLOCK);
-       /* Wait for an incoming connection */
-       add_wait_queue_exclusive(sk_sleep(sk), &wait);
-diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c
-index fde1140d899ef..4eb52add7103b 100644
---- a/net/llc/af_llc.c
-+++ b/net/llc/af_llc.c
-@@ -688,14 +688,13 @@ static void llc_cmsg_rcv(struct msghdr *msg, struct sk_buff *skb)
-  *    llc_ui_accept - accept a new incoming connection.
-  *    @sock: Socket which connections arrive on.
-  *    @newsock: Socket to move incoming connection to.
-- *    @flags: User specified operational flags.
-- *    @kern: If the socket is kernel internal
-+ *    @arg: User specified arguments
-  *
-  *    Accept a new incoming connection.
-  *    Returns 0 upon success, negative otherwise.
-  */
--static int llc_ui_accept(struct socket *sock, struct socket *newsock, int flags,
--                       bool kern)
-+static int llc_ui_accept(struct socket *sock, struct socket *newsock,
-+                       struct proto_accept_arg *arg)
- {
-       struct sock *sk = sock->sk, *newsk;
-       struct llc_sock *llc, *newllc;
-diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
-index 4ace52e4211ad..1f0c8cdc8dd55 100644
---- a/net/mptcp/protocol.c
-+++ b/net/mptcp/protocol.c
-@@ -3852,11 +3852,10 @@ static int mptcp_listen(struct socket *sock, int backlog)
- }
- static int mptcp_stream_accept(struct socket *sock, struct socket *newsock,
--                             int flags, bool kern)
-+                             struct proto_accept_arg *arg)
- {
-       struct mptcp_sock *msk = mptcp_sk(sock->sk);
-       struct sock *ssk, *newsk;
--      int err;
-       pr_debug("msk=%p", msk);
-@@ -3868,9 +3867,9 @@ static int mptcp_stream_accept(struct socket *sock, struct socket *newsock,
-               return -EINVAL;
-       pr_debug("ssk=%p, listener=%p", ssk, mptcp_subflow_ctx(ssk));
--      newsk = inet_csk_accept(ssk, flags, &err, kern);
-+      newsk = inet_csk_accept(ssk, arg);
-       if (!newsk)
--              return err;
-+              return arg->err;
-       pr_debug("newsk=%p, subflow is mptcp=%d", newsk, sk_is_mptcp(newsk));
-       if (sk_is_mptcp(newsk)) {
-@@ -3891,7 +3890,7 @@ static int mptcp_stream_accept(struct socket *sock, struct socket *newsock,
-               newsk = new_mptcp_sock;
-               MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_MPCAPABLEPASSIVEACK);
--              newsk->sk_kern_sock = kern;
-+              newsk->sk_kern_sock = arg->kern;
-               lock_sock(newsk);
-               __inet_accept(sock, newsock, newsk);
-@@ -3920,7 +3919,7 @@ static int mptcp_stream_accept(struct socket *sock, struct socket *newsock,
-               }
-       } else {
- tcpfallback:
--              newsk->sk_kern_sock = kern;
-+              newsk->sk_kern_sock = arg->kern;
-               lock_sock(newsk);
-               __inet_accept(sock, newsock, newsk);
-               /* we are being invoked after accepting a non-mp-capable
-diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
-index f26dee48e03af..1a1713f3aaf82 100644
---- a/net/netrom/af_netrom.c
-+++ b/net/netrom/af_netrom.c
-@@ -772,8 +772,8 @@ static int nr_connect(struct socket *sock, struct sockaddr *uaddr,
-       return err;
- }
--static int nr_accept(struct socket *sock, struct socket *newsock, int flags,
--                   bool kern)
-+static int nr_accept(struct socket *sock, struct socket *newsock,
-+                   struct proto_accept_arg *arg)
- {
-       struct sk_buff *skb;
-       struct sock *newsk;
-@@ -805,7 +805,7 @@ static int nr_accept(struct socket *sock, struct socket *newsock, int flags,
-               if (skb)
-                       break;
--              if (flags & O_NONBLOCK) {
-+              if (arg->flags & O_NONBLOCK) {
-                       err = -EWOULDBLOCK;
-                       break;
-               }
-diff --git a/net/nfc/llcp_sock.c b/net/nfc/llcp_sock.c
-index 819157bbb5a2c..ff1768e4b7bb3 100644
---- a/net/nfc/llcp_sock.c
-+++ b/net/nfc/llcp_sock.c
-@@ -447,7 +447,7 @@ struct sock *nfc_llcp_accept_dequeue(struct sock *parent,
- }
- static int llcp_sock_accept(struct socket *sock, struct socket *newsock,
--                          int flags, bool kern)
-+                          struct proto_accept_arg *arg)
- {
-       DECLARE_WAITQUEUE(wait, current);
-       struct sock *sk = sock->sk, *new_sk;
-@@ -463,7 +463,7 @@ static int llcp_sock_accept(struct socket *sock, struct socket *newsock,
-               goto error;
-       }
--      timeo = sock_rcvtimeo(sk, flags & O_NONBLOCK);
-+      timeo = sock_rcvtimeo(sk, arg->flags & O_NONBLOCK);
-       /* Wait for an incoming connection. */
-       add_wait_queue_exclusive(sk_sleep(sk), &wait);
-diff --git a/net/phonet/pep.c b/net/phonet/pep.c
-index 3dd5f52bc1b58..53a858478e22f 100644
---- a/net/phonet/pep.c
-+++ b/net/phonet/pep.c
-@@ -759,8 +759,8 @@ static void pep_sock_close(struct sock *sk, long timeout)
-       sock_put(sk);
- }
--static struct sock *pep_sock_accept(struct sock *sk, int flags, int *errp,
--                                  bool kern)
-+static struct sock *pep_sock_accept(struct sock *sk,
-+                                  struct proto_accept_arg *arg)
- {
-       struct pep_sock *pn = pep_sk(sk), *newpn;
-       struct sock *newsk = NULL;
-@@ -772,8 +772,8 @@ static struct sock *pep_sock_accept(struct sock *sk, int flags, int *errp,
-       u8 pipe_handle, enabled, n_sb;
-       u8 aligned = 0;
--      skb = skb_recv_datagram(sk, (flags & O_NONBLOCK) ? MSG_DONTWAIT : 0,
--                              errp);
-+      skb = skb_recv_datagram(sk, (arg->flags & O_NONBLOCK) ? MSG_DONTWAIT : 0,
-+                              &arg->err);
-       if (!skb)
-               return NULL;
-@@ -836,7 +836,7 @@ static struct sock *pep_sock_accept(struct sock *sk, int flags, int *errp,
-       /* Create a new to-be-accepted sock */
-       newsk = sk_alloc(sock_net(sk), PF_PHONET, GFP_KERNEL, sk->sk_prot,
--                       kern);
-+                       arg->kern);
-       if (!newsk) {
-               pep_reject_conn(sk, skb, PN_PIPE_ERR_OVERLOAD, GFP_KERNEL);
-               err = -ENOBUFS;
-@@ -878,7 +878,7 @@ static struct sock *pep_sock_accept(struct sock *sk, int flags, int *errp,
- drop:
-       release_sock(sk);
-       kfree_skb(skb);
--      *errp = err;
-+      arg->err = err;
-       return newsk;
- }
-diff --git a/net/phonet/socket.c b/net/phonet/socket.c
-index 1018340d89a7d..5ce0b3ee5def8 100644
---- a/net/phonet/socket.c
-+++ b/net/phonet/socket.c
-@@ -292,18 +292,17 @@ static int pn_socket_connect(struct socket *sock, struct sockaddr *addr,
- }
- static int pn_socket_accept(struct socket *sock, struct socket *newsock,
--                          int flags, bool kern)
-+                          struct proto_accept_arg *arg)
- {
-       struct sock *sk = sock->sk;
-       struct sock *newsk;
--      int err;
-       if (unlikely(sk->sk_state != TCP_LISTEN))
-               return -EINVAL;
--      newsk = sk->sk_prot->accept(sk, flags, &err, kern);
-+      newsk = sk->sk_prot->accept(sk, arg);
-       if (!newsk)
--              return err;
-+              return arg->err;
-       lock_sock(newsk);
-       sock_graft(newsk, newsock);
-diff --git a/net/rds/tcp_listen.c b/net/rds/tcp_listen.c
-index 53b3535a1e4a8..eb0b5373d7dab 100644
---- a/net/rds/tcp_listen.c
-+++ b/net/rds/tcp_listen.c
-@@ -105,6 +105,10 @@ int rds_tcp_accept_one(struct socket *sock)
-       int conn_state;
-       struct rds_conn_path *cp;
-       struct in6_addr *my_addr, *peer_addr;
-+      struct proto_accept_arg arg = {
-+              .flags = O_NONBLOCK,
-+              .kern = true,
-+      };
- #if !IS_ENABLED(CONFIG_IPV6)
-       struct in6_addr saddr, daddr;
- #endif
-@@ -119,7 +123,7 @@ int rds_tcp_accept_one(struct socket *sock)
-       if (ret)
-               goto out;
--      ret = sock->ops->accept(sock, new_sock, O_NONBLOCK, true);
-+      ret = sock->ops->accept(sock, new_sock, &arg);
-       if (ret < 0)
-               goto out;
-diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
-index 42e8b9e37516b..cc7afa4198f03 100644
---- a/net/rose/af_rose.c
-+++ b/net/rose/af_rose.c
-@@ -919,8 +919,8 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le
-       return err;
- }
--static int rose_accept(struct socket *sock, struct socket *newsock, int flags,
--                     bool kern)
-+static int rose_accept(struct socket *sock, struct socket *newsock,
-+                     struct proto_accept_arg *arg)
- {
-       struct sk_buff *skb;
-       struct sock *newsk;
-@@ -953,7 +953,7 @@ static int rose_accept(struct socket *sock, struct socket *newsock, int flags,
-               if (skb)
-                       break;
--              if (flags & O_NONBLOCK) {
-+              if (arg->flags & O_NONBLOCK) {
-                       err = -EWOULDBLOCK;
-                       break;
-               }
-diff --git a/net/sctp/socket.c b/net/sctp/socket.c
-index 6b9fcdb0952a0..c6963210c7ee1 100644
---- a/net/sctp/socket.c
-+++ b/net/sctp/socket.c
-@@ -4846,7 +4846,7 @@ static int sctp_disconnect(struct sock *sk, int flags)
-  * descriptor will be returned from accept() to represent the newly
-  * formed association.
-  */
--static struct sock *sctp_accept(struct sock *sk, int flags, int *err, bool kern)
-+static struct sock *sctp_accept(struct sock *sk, struct proto_accept_arg *arg)
- {
-       struct sctp_sock *sp;
-       struct sctp_endpoint *ep;
-@@ -4870,7 +4870,7 @@ static struct sock *sctp_accept(struct sock *sk, int flags, int *err, bool kern)
-               goto out;
-       }
--      timeo = sock_rcvtimeo(sk, flags & O_NONBLOCK);
-+      timeo = sock_rcvtimeo(sk, arg->flags & O_NONBLOCK);
-       error = sctp_wait_for_accept(sk, timeo);
-       if (error)
-@@ -4881,7 +4881,7 @@ static struct sock *sctp_accept(struct sock *sk, int flags, int *err, bool kern)
-        */
-       asoc = list_entry(ep->asocs.next, struct sctp_association, asocs);
--      newsk = sp->pf->create_accept_sk(sk, asoc, kern);
-+      newsk = sp->pf->create_accept_sk(sk, asoc, arg->kern);
-       if (!newsk) {
-               error = -ENOMEM;
-               goto out;
-@@ -4898,7 +4898,7 @@ static struct sock *sctp_accept(struct sock *sk, int flags, int *err, bool kern)
- out:
-       release_sock(sk);
--      *err = error;
-+      arg->err = error;
-       return newsk;
- }
-diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
-index 3158b94fd347a..b9bd340814e97 100644
---- a/net/smc/af_smc.c
-+++ b/net/smc/af_smc.c
-@@ -2633,7 +2633,7 @@ static int smc_listen(struct socket *sock, int backlog)
- }
- static int smc_accept(struct socket *sock, struct socket *new_sock,
--                    int flags, bool kern)
-+                    struct proto_accept_arg *arg)
- {
-       struct sock *sk = sock->sk, *nsk;
-       DECLARE_WAITQUEUE(wait, current);
-@@ -2652,7 +2652,7 @@ static int smc_accept(struct socket *sock, struct socket *new_sock,
-       }
-       /* Wait for an incoming connection */
--      timeo = sock_rcvtimeo(sk, flags & O_NONBLOCK);
-+      timeo = sock_rcvtimeo(sk, arg->flags & O_NONBLOCK);
-       add_wait_queue_exclusive(sk_sleep(sk), &wait);
-       while (!(nsk = smc_accept_dequeue(sk, new_sock))) {
-               set_current_state(TASK_INTERRUPTIBLE);
-@@ -2679,7 +2679,7 @@ static int smc_accept(struct socket *sock, struct socket *new_sock,
-       if (rc)
-               goto out;
--      if (lsmc->sockopt_defer_accept && !(flags & O_NONBLOCK)) {
-+      if (lsmc->sockopt_defer_accept && !(arg->flags & O_NONBLOCK)) {
-               /* wait till data arrives on the socket */
-               timeo = msecs_to_jiffies(lsmc->sockopt_defer_accept *
-                                                               MSEC_PER_SEC);
-diff --git a/net/socket.c b/net/socket.c
-index 8d83c4bb163b4..5ff2107186001 100644
---- a/net/socket.c
-+++ b/net/socket.c
-@@ -1902,6 +1902,9 @@ struct file *do_accept(struct file *file, unsigned file_flags,
-       struct file *newfile;
-       int err, len;
-       struct sockaddr_storage address;
-+      struct proto_accept_arg arg = {
-+              .flags = file_flags,
-+      };
-       const struct proto_ops *ops;
-       sock = sock_from_file(file);
-@@ -1930,8 +1933,8 @@ struct file *do_accept(struct file *file, unsigned file_flags,
-       if (err)
-               goto out_fd;
--      err = ops->accept(sock, newsock, sock->file->f_flags | file_flags,
--                                      false);
-+      arg.flags |= sock->file->f_flags;
-+      err = ops->accept(sock, newsock, &arg);
-       if (err < 0)
-               goto out_fd;
-@@ -3556,6 +3559,10 @@ int kernel_accept(struct socket *sock, struct socket **newsock, int flags)
- {
-       struct sock *sk = sock->sk;
-       const struct proto_ops *ops = READ_ONCE(sock->ops);
-+      struct proto_accept_arg arg = {
-+              .flags = flags,
-+              .kern = true,
-+      };
-       int err;
-       err = sock_create_lite(sk->sk_family, sk->sk_type, sk->sk_protocol,
-@@ -3563,7 +3570,7 @@ int kernel_accept(struct socket *sock, struct socket **newsock, int flags)
-       if (err < 0)
-               goto done;
--      err = ops->accept(sock, *newsock, flags, true);
-+      err = ops->accept(sock, *newsock, &arg);
-       if (err < 0) {
-               sock_release(*newsock);
-               *newsock = NULL;
-diff --git a/net/tipc/socket.c b/net/tipc/socket.c
-index bb1118d02f953..eb996dd3d00f0 100644
---- a/net/tipc/socket.c
-+++ b/net/tipc/socket.c
-@@ -147,8 +147,6 @@ static void tipc_data_ready(struct sock *sk);
- static void tipc_write_space(struct sock *sk);
- static void tipc_sock_destruct(struct sock *sk);
- static int tipc_release(struct socket *sock);
--static int tipc_accept(struct socket *sock, struct socket *new_sock, int flags,
--                     bool kern);
- static void tipc_sk_timeout(struct timer_list *t);
- static int tipc_sk_publish(struct tipc_sock *tsk, struct tipc_uaddr *ua);
- static int tipc_sk_withdraw(struct tipc_sock *tsk, struct tipc_uaddr *ua);
-@@ -2712,13 +2710,12 @@ static int tipc_wait_for_accept(struct socket *sock, long timeo)
-  * tipc_accept - wait for connection request
-  * @sock: listening socket
-  * @new_sock: new socket that is to be connected
-- * @flags: file-related flags associated with socket
-- * @kern: caused by kernel or by userspace?
-+ * @arg: arguments for accept
-  *
-  * Return: 0 on success, errno otherwise
-  */
--static int tipc_accept(struct socket *sock, struct socket *new_sock, int flags,
--                     bool kern)
-+static int tipc_accept(struct socket *sock, struct socket *new_sock,
-+                     struct proto_accept_arg *arg)
- {
-       struct sock *new_sk, *sk = sock->sk;
-       struct tipc_sock *new_tsock;
-@@ -2734,14 +2731,14 @@ static int tipc_accept(struct socket *sock, struct socket *new_sock, int flags,
-               res = -EINVAL;
-               goto exit;
-       }
--      timeo = sock_rcvtimeo(sk, flags & O_NONBLOCK);
-+      timeo = sock_rcvtimeo(sk, arg->flags & O_NONBLOCK);
-       res = tipc_wait_for_accept(sock, timeo);
-       if (res)
-               goto exit;
-       buf = skb_peek(&sk->sk_receive_queue);
--      res = tipc_sk_create(sock_net(sock->sk), new_sock, 0, kern);
-+      res = tipc_sk_create(sock_net(sock->sk), new_sock, 0, arg->kern);
-       if (res)
-               goto exit;
-       security_sk_clone(sock->sk, new_sock->sk);
-diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
-index 9d48eef5d62e3..ab57fa0595e21 100644
---- a/net/unix/af_unix.c
-+++ b/net/unix/af_unix.c
-@@ -750,7 +750,7 @@ static int unix_bind(struct socket *, struct sockaddr *, int);
- static int unix_stream_connect(struct socket *, struct sockaddr *,
-                              int addr_len, int flags);
- static int unix_socketpair(struct socket *, struct socket *);
--static int unix_accept(struct socket *, struct socket *, int, bool);
-+static int unix_accept(struct socket *, struct socket *, struct proto_accept_arg *arg);
- static int unix_getname(struct socket *, struct sockaddr *, int);
- static __poll_t unix_poll(struct file *, struct socket *, poll_table *);
- static __poll_t unix_dgram_poll(struct file *, struct socket *,
-@@ -1699,19 +1699,18 @@ static void unix_sock_inherit_flags(const struct socket *old,
-               set_bit(SOCK_PASSSEC, &new->flags);
- }
--static int unix_accept(struct socket *sock, struct socket *newsock, int flags,
--                     bool kern)
-+static int unix_accept(struct socket *sock, struct socket *newsock,
-+                     struct proto_accept_arg *arg)
- {
-       struct sock *sk = sock->sk;
-       struct sk_buff *skb;
-       struct sock *tsk;
--      int err;
--      err = -EOPNOTSUPP;
-+      arg->err = -EOPNOTSUPP;
-       if (sock->type != SOCK_STREAM && sock->type != SOCK_SEQPACKET)
-               goto out;
--      err = -EINVAL;
-+      arg->err = -EINVAL;
-       if (sk->sk_state != TCP_LISTEN)
-               goto out;
-@@ -1719,12 +1718,12 @@ static int unix_accept(struct socket *sock, struct socket *newsock, int flags,
-        * so that no locks are necessary.
-        */
--      skb = skb_recv_datagram(sk, (flags & O_NONBLOCK) ? MSG_DONTWAIT : 0,
--                              &err);
-+      skb = skb_recv_datagram(sk, (arg->flags & O_NONBLOCK) ? MSG_DONTWAIT : 0,
-+                              &arg->err);
-       if (!skb) {
-               /* This means receive shutdown. */
--              if (err == 0)
--                      err = -EINVAL;
-+              if (arg->err == 0)
-+                      arg->err = -EINVAL;
-               goto out;
-       }
-@@ -1742,7 +1741,7 @@ static int unix_accept(struct socket *sock, struct socket *newsock, int flags,
-       return 0;
- out:
--      return err;
-+      return arg->err;
- }
-diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
-index 4afb6a541cf38..22cc19e797914 100644
---- a/net/vmw_vsock/af_vsock.c
-+++ b/net/vmw_vsock/af_vsock.c
-@@ -1489,8 +1489,8 @@ static int vsock_connect(struct socket *sock, struct sockaddr *addr,
-       return err;
- }
--static int vsock_accept(struct socket *sock, struct socket *newsock, int flags,
--                      bool kern)
-+static int vsock_accept(struct socket *sock, struct socket *newsock,
-+                      struct proto_accept_arg *arg)
- {
-       struct sock *listener;
-       int err;
-@@ -1517,7 +1517,7 @@ static int vsock_accept(struct socket *sock, struct socket *newsock, int flags,
-       /* Wait for children sockets to appear; these are the new sockets
-        * created upon connection establishment.
-        */
--      timeout = sock_rcvtimeo(listener, flags & O_NONBLOCK);
-+      timeout = sock_rcvtimeo(listener, arg->flags & O_NONBLOCK);
-       prepare_to_wait(sk_sleep(listener), &wait, TASK_INTERRUPTIBLE);
-       while ((connected = vsock_dequeue_accept(listener)) == NULL &&
-diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
-index f15a4493eb0bf..b2074b0cd6129 100644
---- a/net/x25/af_x25.c
-+++ b/net/x25/af_x25.c
-@@ -871,8 +871,8 @@ static int x25_wait_for_data(struct sock *sk, long timeout)
-       return rc;
- }
--static int x25_accept(struct socket *sock, struct socket *newsock, int flags,
--                    bool kern)
-+static int x25_accept(struct socket *sock, struct socket *newsock,
-+                    struct proto_accept_arg *arg)
- {
-       struct sock *sk = sock->sk;
-       struct sock *newsk;
--- 
-2.43.0
-
index 3e123e1e464a5c9e915ec889e02ddaae4f16e1bc..269f6dc262e517629b76dd541c29b684de0a82dc 100644 (file)
@@ -139,12 +139,6 @@ drm-vmwgfx-filter-modes-which-exceed-graphics-memory.patch
 drm-vmwgfx-3d-disabled-should-not-effect-stdu-memory.patch
 drm-vmwgfx-remove-stdu-logic-from-generic-mode_valid.patch
 drm-vmwgfx-don-t-memcmp-equivalent-pointers.patch
-af_unix-return-struct-unix_sock-from-unix_get_socket.patch
-af_unix-run-gc-on-only-one-cpu.patch
-af_unix-try-to-run-gc-async.patch
-af_unix-replace-bug_on-with-warn_on_once.patch
-af_unix-save-listener-for-embryo-socket.patch
-net-change-proto-and-proto_ops-accept-type.patch
 af_unix-annotate-data-race-of-sk-sk_state-in-unix_ac.patch
 modpost-do-not-warn-about-missing-module_description.patch
 net-sfp-always-call-sfp_sm_mod_remove-on-remove.patch