[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zx1S9vf2i7O+BNE+@pop-os.localdomain>
Date: Sat, 26 Oct 2024 13:37:10 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: mrpre <mrpre@....com>
Cc: edumazet@...gle.com, jakub@...udflare.com, davem@...emloft.net,
dsahern@...nel.org, kuba@...nel.org, pabeni@...hat.com,
netdev@...r.kernel.org, bpf@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] bpf: fix filed access without lock
On Mon, Oct 21, 2024 at 09:37:05AM +0800, mrpre wrote:
> The tcp_bpf_recvmsg_parser() function, running in user context,
> retrieves seq_copied from tcp_sk without holding the socket lock, and
> stores it in a local variable seq. However, the softirq context can
> modify tcp_sk->seq_copied concurrently, for example, n tcp_read_sock().
>
> As a result, the seq value is stale when it is assigned back to
> tcp_sk->copied_seq at the end of tcp_bpf_recvmsg_parser(), leading to
> incorrect behavior.
Good catch! This makes sense to me. Mind to be more specific on the
"incorrect behavior" here? What error or misbehavior did you see?
>
> Signed-off-by: mrpre <mrpre@....com>
Please use your real name for SoB, see https://docs.kernel.org/process/submitting-patches.html
Thanks.
Powered by blists - more mailing lists