]> git.ipfire.org Git - thirdparty/kernel/linux.git/blobdiff - io_uring/io_uring.c
io_uring: drop any code related to SCM_RIGHTS
[thirdparty/kernel/linux.git] / io_uring / io_uring.c
index a9acccd45880d62b9c998361f8a7c3f914f1f6f8..a9a519fa9926ed2c665085290ef76bcf756106bb 100644 (file)
@@ -60,7 +60,6 @@
 #include <linux/net.h>
 #include <net/sock.h>
 #include <net/af_unix.h>
-#include <net/scm.h>
 #include <linux/anon_inodes.h>
 #include <linux/sched/mm.h>
 #include <linux/uaccess.h>
@@ -2866,13 +2865,6 @@ static __cold void io_ring_ctx_free(struct io_ring_ctx *ctx)
                io_rsrc_node_destroy(ctx, ctx->rsrc_node);
 
        WARN_ON_ONCE(!list_empty(&ctx->rsrc_ref_list));
-
-#if defined(CONFIG_UNIX)
-       if (ctx->ring_sock) {
-               ctx->ring_sock->file = NULL; /* so that iput() is called */
-               sock_release(ctx->ring_sock);
-       }
-#endif
        WARN_ON_ONCE(!list_empty(&ctx->ltimeout_list));
 
        io_alloc_cache_free(&ctx->rsrc_node_cache, io_rsrc_node_cache_free);
@@ -3781,32 +3773,12 @@ static int io_uring_install_fd(struct file *file)
 /*
  * Allocate an anonymous fd, this is what constitutes the application
  * visible backing of an io_uring instance. The application mmaps this
- * fd to gain access to the SQ/CQ ring details. If UNIX sockets are enabled,
- * we have to tie this fd to a socket for file garbage collection purposes.
+ * fd to gain access to the SQ/CQ ring details.
  */
 static struct file *io_uring_get_file(struct io_ring_ctx *ctx)
 {
-       struct file *file;
-#if defined(CONFIG_UNIX)
-       int ret;
-
-       ret = sock_create_kern(&init_net, PF_UNIX, SOCK_RAW, IPPROTO_IP,
-                               &ctx->ring_sock);
-       if (ret)
-               return ERR_PTR(ret);
-#endif
-
-       file = anon_inode_getfile_secure("[io_uring]", &io_uring_fops, ctx,
+       return anon_inode_getfile_secure("[io_uring]", &io_uring_fops, ctx,
                                         O_RDWR | O_CLOEXEC, NULL);
-#if defined(CONFIG_UNIX)
-       if (IS_ERR(file)) {
-               sock_release(ctx->ring_sock);
-               ctx->ring_sock = NULL;
-       } else {
-               ctx->ring_sock->file = file;
-       }
-#endif
-       return file;
 }
 
 static __cold int io_uring_create(unsigned entries, struct io_uring_params *p,