History

Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

No conflicts.

Jakub Kicinski committed 4 years ago

Commit 5b91c5c2 parents 4f5e483 f1baf68328 files · +4072 −1720Browse files

Showing the changes to kernel (2 of 328 files). Show all

Unified · Split

2 files
  1. kernel/auditsc.c +1 −1
  2. kernel/events/core.c +16 −0
kernel/auditsc.c+1−1
@@ -185,7 +185,7 @@ static int audit_match_perm(struct audit_context *ctx, int mask) · 184 unmodified lines
185185 case AUDITSC_EXECVE:
186186 return mask & AUDIT_PERM_EXEC;
187187 case AUDITSC_OPENAT2:
188− return mask & ACC_MODE((u32)((struct open_how *)ctx->argv[2])->flags);
188+ return mask & ACC_MODE((u32)ctx->openat2.flags);
189189 default:
190190 return 0;
191191 }
kernel/events/core.c+16−0
@@ -3238,6 +3238,15 @@ static int perf_event_modify_breakpoint(struct perf_event *bp, · 3237 unmodified lines
32383238 return err;
32393239 }
32403240
3241+/*
3242+ * Copy event-type-independent attributes that may be modified.
3243+ */
3244+static void perf_event_modify_copy_attr(struct perf_event_attr *to,
3245+ const struct perf_event_attr *from)
3246+{
3247+ to->sig_data = from->sig_data;
3248+}
3249+
32413250 static int perf_event_modify_attr(struct perf_event *event,
32423251 struct perf_event_attr *attr)
32433252 {
@@ -3260,10 +3269,17 @@ static int perf_event_modify_attr(struct perf_event *event, · 16 unmodified lines
32603269 WARN_ON_ONCE(event->ctx->parent_ctx);
32613270
32623271 mutex_lock(&event->child_mutex);
3272+ /*
3273+ * Event-type-independent attributes must be copied before event-type
3274+ * modification, which will validate that final attributes match the
3275+ * source attributes after all relevant attributes have been copied.
3276+ */
3277+ perf_event_modify_copy_attr(&event->attr, attr);
32633278 err = func(event, attr);
32643279 if (err)
32653280 goto out;
32663281 list_for_each_entry(child, &event->child_list, child_list) {
3282+ perf_event_modify_copy_attr(&child->attr, attr);
32673283 err = func(child, attr);
32683284 if (err)
32693285 goto out;