On Tue, Aug 6, 2019, at 11:06 PM, Yonghong Song wrote: [...] > > +int perf_event_query_kprobe(struct perf_event *event, void __user *info) > > +{ > > + struct perf_event_query_kprobe __user *uquery = info; > > + struct perf_event_query_kprobe query = {}; > > + struct trace_event_call *call = event->tp_event; > > + struct trace_kprobe *tk = (struct trace_kprobe *)call->data; > > + u64 nmissed, nhit; > > + > > + if (!capable(CAP_SYS_ADMIN)) > > + return -EPERM; > > + if (copy_from_user(&query, uquery, sizeof(query))) > > + return -EFAULT; > > + if (query.size != sizeof(query)) > > + return -EINVAL; > > Note that here we did not handle any backward or forward compatibility. > I intended this to be reserved for future changes. Sort of like how new syscalls will check for unknown flags. I can remove this if it's a problem.