Merge tag 'io_uring-6.5-2023-07-21' of git://git.kernel.dk/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 22 Jul 2023 17:46:30 +0000 (10:46 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 22 Jul 2023 17:46:30 +0000 (10:46 -0700)
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()

1  2 
arch/parisc/kernel/sys_parisc.c

index 9915062d5243c38776dcb2296faa9165e32d55bd,465b7cb9d44f46748607f1d92c9844d195d61fb4..ca2d537e25b1872ab15126c28aa892a13b2ca0ed
  #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)
@@@ -112,7 -116,7 +117,7 @@@ static unsigned long arch_get_unmapped_
        do_color_align = 0;
        if (filp || (flags & MAP_SHARED))
                do_color_align = 1;
-       filp_pgoff = GET_FILP_PGOFF(filp);
+       filp_pgoff = GET_FILP_PGOFF(filp, addr);
  
        if (flags & MAP_FIXED) {
                /* Even MAP_FIXED mappings must reside within TASK_SIZE */
@@@ -340,7 -344,7 +345,7 @@@ asmlinkage long parisc_fallocate(int fd
                              ((u64)lenhi << 32) | lenlo);
  }
  
 -long parisc_personality(unsigned long personality)
 +asmlinkage long parisc_personality(unsigned long personality)
  {
        long err;