From: Linus Torvalds <torvalds@linux-foundation.org>
Date: Sat, 22 Jul 2023 17:46:30 +0000 (-0700)
Subject: Merge tag 'io_uring-6.5-2023-07-21' of git://git.kernel.dk/linux
X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=bdd1d82e7d02bd2764a68a5cc54533dfc2ba452a;p=linux.git

Merge tag 'io_uring-6.5-2023-07-21' of git://git.kernel.dk/linux

Pull io_uring fixes from Jens Axboe:

 - Fix for io-wq not always honoring REQ_F_NOWAIT, if it was set and
   punted directly (eg via DRAIN) (me)

 - Capability check fix (Ondrej)

 - Regression fix for the mmap changes that went into 6.4, which
   apparently broke IA64 (Helge)

* tag 'io_uring-6.5-2023-07-21' of git://git.kernel.dk/linux:
  ia64: mmap: Consider pgoff when searching for free mapping
  io_uring: Fix io_uring mmap() by using architecture-provided get_unmapped_area()
  io_uring: treat -EAGAIN for REQ_F_NOWAIT as final for io-wq
  io_uring: don't audit the capability check in io_uring_create()
---

bdd1d82e7d02bd2764a68a5cc54533dfc2ba452a
diff --cc arch/parisc/kernel/sys_parisc.c
index 9915062d5243c,465b7cb9d44f4..ca2d537e25b18
--- a/arch/parisc/kernel/sys_parisc.c
+++ b/arch/parisc/kernel/sys_parisc.c
@@@ -24,15 -24,19 +24,20 @@@
  #include <linux/personality.h>
  #include <linux/random.h>
  #include <linux/compat.h>
 +#include <linux/elf-randomize.h>
  
  /*
-  * Construct an artificial page offset for the mapping based on the physical
+  * Construct an artificial page offset for the mapping based on the virtual
   * address of the kernel file mapping variable.
+  * If filp is zero the calculated pgoff value aliases the memory of the given
+  * address. This is useful for io_uring where the mapping shall alias a kernel
+  * address and a userspace adress where both the kernel and the userspace
+  * access the same memory region.
   */
- #define GET_FILP_PGOFF(filp)		\
- 	(filp ? (((unsigned long) filp->f_mapping) >> 8)	\
- 		 & ((SHM_COLOUR-1) >> PAGE_SHIFT) : 0UL)
+ #define GET_FILP_PGOFF(filp, addr)		\
+ 	((filp ? (((unsigned long) filp->f_mapping) >> 8)	\
+ 		 & ((SHM_COLOUR-1) >> PAGE_SHIFT) : 0UL)	\
+ 	  + (addr >> PAGE_SHIFT))
  
  static unsigned long shared_align_offset(unsigned long filp_pgoff,
  					 unsigned long pgoff)