Re: [PATCH net v3 1/1] can: can_skb_set_owner(): fix ref counting if socket was closed before setting skb ownership

2021-02-24 Thread Marc Kleine-Budde
On 24.02.2021 21:32:29, Oliver Hartkopp wrote: > > > To fix this problem, only set skb ownership to sockets which have still > > > a ref count > 0. > > > > > > Cc: Oliver Hartkopp > > > Cc: Andre Naujoks > > > Suggested-by: Eric Dumazet > > > Fixes: 0ae89beb283a ("can: add destructor for self g

Re: [PATCH net v3 1/1] can: can_skb_set_owner(): fix ref counting if socket was closed before setting skb ownership

2021-02-24 Thread Oliver Hartkopp
On 24.02.21 09:53, Eric Dumazet wrote: On Wed, Feb 24, 2021 at 8:59 AM Oleksij Rempel wrote: There are two ref count variables controlling the free()ing of a socket: - struct sock::sk_refcnt - which is changed by sock_hold()/sock_put() - struct sock::sk_wmem_alloc - which accounts the memor

Re: [PATCH net v3 1/1] can: can_skb_set_owner(): fix ref counting if socket was closed before setting skb ownership

2021-02-24 Thread Eric Dumazet
On Wed, Feb 24, 2021 at 8:59 AM Oleksij Rempel wrote: > > There are two ref count variables controlling the free()ing of a socket: > - struct sock::sk_refcnt - which is changed by sock_hold()/sock_put() > - struct sock::sk_wmem_alloc - which accounts the memory allocated by > the skbs in the sen

[PATCH net v3 1/1] can: can_skb_set_owner(): fix ref counting if socket was closed before setting skb ownership

2021-02-24 Thread Oleksij Rempel
There are two ref count variables controlling the free()ing of a socket: - struct sock::sk_refcnt - which is changed by sock_hold()/sock_put() - struct sock::sk_wmem_alloc - which accounts the memory allocated by the skbs in the send path. In case there are still TX skbs on the fly and the socke