aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-12-08 12:32:38 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2023-12-08 12:32:38 -0800
commit689659c988193f1e16bc34bfda3f333b11528c1f (patch)
tree6dae14a4f8f7f489c8cba8e9799b7c8199e9a46f /net/core
parent8aa74869d2e9d868b1c4598eecc1a89f637a92cf (diff)
parent705318a99a138c29a512a72c3e0043b3cd7f55f4 (diff)
downloadlinux-689659c988193f1e16bc34bfda3f333b11528c1f.tar.gz
Merge tag 'io_uring-6.7-2023-12-08' of git://git.kernel.dk/linux
Pull io_uring fixes from Jens Axboe: "Two minor fixes for issues introduced in this release cycle, and two fixes for issues or potential issues that are heading to stable. One of these ends up disabling passing io_uring file descriptors via SCM_RIGHTS. There really shouldn't be an overlap between that kind of historic use case and modern usage of io_uring, which is why this was deemed appropriate" * tag 'io_uring-6.7-2023-12-08' of git://git.kernel.dk/linux: io_uring/af_unix: disable sending io_uring over sockets io_uring/kbuf: check for buffer list readiness after NULL check io_uring/kbuf: Fix an NULL vs IS_ERR() bug in io_alloc_pbuf_ring() io_uring: fix mutex_unlock with unreferenced ctx
Diffstat (limited to 'net/core')
-rw-r--r--net/core/scm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/core/scm.c b/net/core/scm.c
index 880027ecf51650..7dc47c17d8638a 100644
--- a/net/core/scm.c
+++ b/net/core/scm.c
@@ -26,6 +26,7 @@
#include <linux/nsproxy.h>
#include <linux/slab.h>
#include <linux/errqueue.h>
+#include <linux/io_uring.h>
#include <linux/uaccess.h>
@@ -103,6 +104,11 @@ static int scm_fp_copy(struct cmsghdr *cmsg, struct scm_fp_list **fplp)
if (fd < 0 || !(file = fget_raw(fd)))
return -EBADF;
+ /* don't allow io_uring files */
+ if (io_uring_get_socket(file)) {
+ fput(file);
+ return -EINVAL;
+ }
*fpp++ = file;
fpl->count++;
}