Message ID | x49sffq4nvg.fsf@segfault.boston.devel.redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v2] aio: fix mremap after fork null-deref | expand |
diff --git a/fs/aio.c b/fs/aio.c index 562916d85cba..e85ba0b77f59 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -361,6 +361,9 @@ static int aio_ring_mremap(struct vm_area_struct *vma) spin_lock(&mm->ioctx_lock); rcu_read_lock(); table = rcu_dereference(mm->ioctx_table); + if (!table) + goto out_unlock; + for (i = 0; i < table->nr; i++) { struct kioctx *ctx; @@ -374,6 +377,7 @@ static int aio_ring_mremap(struct vm_area_struct *vma) } } +out_unlock: rcu_read_unlock(); spin_unlock(&mm->ioctx_lock); return res;