Re: [PATCH 1/3] tracing/kprobe: Add PERF_EVENT_IOC_QUERY_KPROBE ioctl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux