[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190424001206.GA1247@mini-arch>
Date: Tue, 23 Apr 2019 17:12:06 -0700
From: Stanislav Fomichev <sdf@...ichev.me>
To: Jakub Kicinski <jakub.kicinski@...ronome.com>
Cc: Stanislav Fomichev <sdf@...gle.com>, netdev@...r.kernel.org,
bpf@...r.kernel.org, davem@...emloft.net, ast@...nel.org,
daniel@...earbox.net, quentin.monnet@...ronome.com
Subject: Re: [PATCH bpf-next 1/2] bpf: support BPF_PROG_QUERY for
BPF_FLOW_DISSECTOR attach_type
On 04/23, Jakub Kicinski wrote:
> On Tue, 23 Apr 2019 16:21:59 -0700, Stanislav Fomichev wrote:
> > + rcu_read_lock();
> > + attached = rcu_dereference(net->flow_dissector_prog);
> > + if (attached) {
> > + cnt = 1;
> > + if (prog_ids &&
> > + copy_to_user(prog_ids, &attached->aux->id, sizeof(u32))) {
>
> Not sure you can do copy_to_user inside an RCU section, doesn't it
> sleep?
Good point, I need to copy that aux->id somewhere and exit rcu section.
> > + rcu_read_unlock();
> > + return -EFAULT;
> > + }
> > + }
> > + rcu_read_unlock();
>
Powered by blists - more mailing lists