RE: [PATCH bpf-next v2 02/11] net, sk_msg: Annotate lockless access to sk_prot on clone

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

 



Jakub Sitnicki wrote:
> sk_msg and ULP frameworks override protocol callbacks pointer in
> sk->sk_prot, while TCP accesses it locklessly when cloning the listening
> socket.
> 
> Once we enable use of listening sockets with sockmap (and hence sk_msg),
> there can be shared access to sk->sk_prot if socket is getting cloned while
> being inserted/deleted to/from the sockmap from another CPU. Mark the
> shared access with READ_ONCE/WRITE_ONCE annotations.
> 
> Signed-off-by: Jakub Sitnicki <jakub@xxxxxxxxxxxxxx>

In sockmap side I fixed this by wrapping the access in a lock_sock[0]. So
Do you think this is still needed with that in mind? The bpf_clone call
is using sk_prot_creater and also setting the newsk's proto field. Even
if the listening parent sock was being deleted in parallel would that be
a problem? We don't touch sk_prot_creator from the tear down path. I've
only scanned the 3..11 patches so maybe the answer is below. If that is
the case probably an improved commit message would be helpful.

[0] https://patchwork.ozlabs.org/patch/1221536/

Thanks.



[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