[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKD1Yr0Jdj=KZ+MOs8V1WVYg_j3BkWQ6Ncmu9u4YYYu_pxS77A@mail.gmail.com>
Date: Mon, 6 Feb 2017 12:01:47 +0900
From: Lorenzo Colitti <lorenzo@...gle.com>
To: Chenbo Feng <chenbofeng.kernel@...il.com>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Alexei Starovoitov <ast@...com>,
Daniel Borkmann <daniel@...earbox.net>,
Willem de Bruijn <willemb@...gle.com>,
Chenbo Feng <fengc@...gle.com>
Subject: Re: [PATCH net-next v2 1/2] Add a helper function to get socket
cookie in eBPF
On Mon, Feb 6, 2017 at 11:17 AM, Chenbo Feng
<chenbofeng.kernel@...il.com> wrote:
> +BPF_CALL_1(bpf_get_socket_cookie, struct sk_buff *, skb)
> +{
> + return skb->sk ? sock_gen_cookie(skb->sk) : 0;
> +}
> +
Does this code need to increment the socket refcount, or call
ACCESS_ONCE to get skb->sk? The socket filter codepath should be safe,
but if this function is called in xt_ebpf, could it race with
something that sets skb->sk to null?
Powered by blists - more mailing lists