Skip to contentSkip to conversation

perf: Start rejecting the syscall with attr.__reserved_2 set

PATCH Applied Alexander Shishkin 2 participants 2 messages Oct 25, 2019 – Oct 28, 2019 perf events

lore
Share & tools
lore

Alexander Shishkin

author reviewer
#0 lore raw

PATCH 1/1 perf: Start rejecting the syscall with attr.__reserved_2 set

Commit

1a5941312414c ("perf: Add wakeup watermark control to the AUX area")

added attr.__reserved_2 padding, but forgot to add an ABI check to reject attributes with this field set. Fix that.

---
 kernel/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/events/core.c +1 -1
index 77793ef0d8bc..0940c8810be0 100644
@@ -10660,7 +10660,7 @@ static int perf_copy_attr(struct perf_event_attr __user *uattr,
 
 	attr->size = size;
 
-	if (attr->__reserved_1)
+	if (attr->__reserved_1 || attr->__reserved_2)
 		return -EINVAL;
 
 	if (attr->sample_type & ~(PERF_SAMPLE_MAX-1))
Signature · 1 line
2.23.0
#1 lore raw

[tip: perf/urgent] perf/core: Start rejecting the syscall with attr.__reserved_2 set

The following commit has been merged into the perf/urgent branch of tip:

The following commit has been merged into the perf/urgent branch of tip:

Commit-ID:     8c7e975667fbc3b7c816119dd56104739899f125
Gitweb:        https://git.kernel.org/tip/8c7e975667fbc3b7c816119dd56104739899f125
Author:        Alexander Shishkin <[email protected]>
AuthorDate:    Fri, 25 Oct 2019 15:16:36 +03:00
Committer:     Ingo Molnar <[email protected]>
CommitterDate: Mon, 28 Oct 2019 11:01:59 +01:00

perf/core: Start rejecting the syscall with attr.__reserved_2 set

Commit:

1a5941312414c ("perf: Add wakeup watermark control to the AUX area")

added attr.__reserved_2 padding, but forgot to add an ABI check to reject attributes with this field set. Fix that.

---
 kernel/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/events/core.c +1 -1
index bb3748d..aec8dba 100644
@@ -10635,7 +10635,7 @@ static int perf_copy_attr(struct perf_event_attr __user *uattr,
 
 	attr->size = size;
 
-	if (attr->__reserved_1)
+	if (attr->__reserved_1 || attr->__reserved_2)
 		return -EINVAL;
 
 	if (attr->sample_type & ~(PERF_SAMPLE_MAX-1))