The quilt patch titled Subject: aio: fix mremap after fork null-deref has been removed from the -mm tree. Its filename was aio-fix-mremap-after-fork-null-deref.patch
This patch was dropped because an updated version will be merged
------------------------------------------------------ From: Seth Jenkins sethjenkins@google.com Subject: aio: fix mremap after fork null-deref Date: Fri, 4 Nov 2022 17:25:19 -0400
Commit e4a0d3e720e7 ("aio: Make it possible to remap aio ring") introduced a null-deref if mremap is called on an old aio mapping after fork as mm->ioctx_table will be set to NULL.
Link: https://lkml.kernel.org/r/20221104212519.538108-1-sethjenkins@google.com Fixes: e4a0d3e720e7 ("aio: Make it possible to remap aio ring") Signed-off-by: Seth Jenkins sethjenkins@google.com Cc: Alexander Viro viro@zeniv.linux.org.uk Cc: Benjamin LaHaise bcrl@kvack.org Cc: Jann Horn jannh@google.com Cc: Pavel Emelyanov xemul@parallels.com Cc: stable@vger.kernel.org Signed-off-by: Andrew Morton akpm@linux-foundation.org ---
fs/aio.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
--- a/fs/aio.c~aio-fix-mremap-after-fork-null-deref +++ a/fs/aio.c @@ -361,16 +361,18 @@ static int aio_ring_mremap(struct vm_are spin_lock(&mm->ioctx_lock); rcu_read_lock(); table = rcu_dereference(mm->ioctx_table); - for (i = 0; i < table->nr; i++) { - struct kioctx *ctx; + if (table) { + for (i = 0; i < table->nr; i++) { + struct kioctx *ctx;
- ctx = rcu_dereference(table->table[i]); - if (ctx && ctx->aio_ring_file == file) { - if (!atomic_read(&ctx->dead)) { - ctx->user_id = ctx->mmap_base = vma->vm_start; - res = 0; + ctx = rcu_dereference(table->table[i]); + if (ctx && ctx->aio_ring_file == file) { + if (!atomic_read(&ctx->dead)) { + ctx->user_id = ctx->mmap_base = vma->vm_start; + res = 0; + } + break; } - break; } }
_
Patches currently in -mm which might be from sethjenkins@google.com are