[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1369990056-10310-7-git-send-email-rric@kernel.org>
Date: Fri, 31 May 2013 10:47:26 +0200
From: Robert Richter <rric@...nel.org>
To: Borislav Petkov <bp@...en8.de>
Cc: Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
linux-kernel@...r.kernel.org,
Robert Richter <robert.richter@...xeda.com>
Subject: [PATCH 06/16] perf, persistent: Return -EACCES if mapped buffers must be readonly
From: Robert Richter <robert.richter@...xeda.com>
mmap should return EACCES error if fd can not be opened writable.
This error code also helps userland to map buffers readonly on
failure.
Signed-off-by: Robert Richter <robert.richter@...xeda.com>
---
kernel/events/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 0730f36..a9b6470 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -3761,7 +3761,7 @@ static int perf_mmap(struct file *file, struct vm_area_struct *vma)
return -EINVAL;
if (event->attr.persistent && (vma->vm_flags & VM_WRITE))
- return -EINVAL;
+ return -EACCES;
vma_size = vma->vm_end - vma->vm_start;
nr_pages = (vma_size / PAGE_SIZE) - 1;
--
1.8.1.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists