Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1565877 > unrolled thread
| Started by | Mike Rapoport <rppt@linux.vnet.ibm.com> |
|---|---|
| First post | 2017-01-24 15:00 +0100 |
| Last post | 2017-01-24 15:00 +0100 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[RFC PATCH 5/5] userfaultfd_copy: return -ENOSPC in case mm has gone Mike Rapoport <rppt@linux.vnet.ibm.com> - 2017-01-24 15:00 +0100
| From | Mike Rapoport <rppt@linux.vnet.ibm.com> |
|---|---|
| Date | 2017-01-24 15:00 +0100 |
| Subject | [RFC PATCH 5/5] userfaultfd_copy: return -ENOSPC in case mm has gone |
| Message-ID | <t39NE-4ZI-21@gated-at.bofh.it> |
In the non-cooperative userfaultfd case, the process exit may race with
outstanding mcopy_atomic called by the uffd monitor. Returning -ENOSPC
instead of -EINVAL when mm is already gone will allow uffd monitor to
distinguish this case from other error conditions.
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
---
fs/userfaultfd.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c
index 839ffd5..6587f40 100644
--- a/fs/userfaultfd.c
+++ b/fs/userfaultfd.c
@@ -1603,6 +1603,8 @@ static int userfaultfd_copy(struct userfaultfd_ctx *ctx,
ret = mcopy_atomic(ctx->mm, uffdio_copy.dst, uffdio_copy.src,
uffdio_copy.len);
mmput(ctx->mm);
+ } else {
+ return -ENOSPC;
}
if (unlikely(put_user(ret, &user_uffdio_copy->copy)))
return -EFAULT;
--
1.9.1
Back to top | Article view | linux.kernel
csiph-web