lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 19 Oct 2022 08:34:37 -0700
From:   Kuniyuki Iwashima <kuniyu@...zon.com>
To:     <matthieu.baerts@...sares.net>
CC:     <davem@...emloft.net>, <dsahern@...nel.org>, <edumazet@...gle.com>,
        <kuba@...nel.org>, <kuni1840@...il.com>, <kuniyu@...zon.com>,
        <mathew.j.martineau@...ux.intel.com>, <mptcp@...ts.linux.dev>,
        <netdev@...r.kernel.org>, <pabeni@...hat.com>,
        <yoshfuji@...ux-ipv6.org>
Subject: Re: [PATCH v1 net-next 1/5] inet6: Remove inet6_destroy_sock() in sk->sk_prot->destroy().

From:   Matthieu Baerts <matthieu.baerts@...sares.net>
Date:   Wed, 19 Oct 2022 15:22:40 +0200
> Hi Kuniyuki,
> 
> +cc MPTCP ML.
> 
> On 18/10/2022 21:09, Kuniyuki Iwashima wrote:
> > After commit d38afeec26ed ("tcp/udp: Call inet6_destroy_sock()
> > in IPv6 sk->sk_destruct()."), we call inet6_destroy_sock() in
> > sk->sk_destruct() by setting inet6_sock_destruct() to it to make
> > sure we do not leak inet6-specific resources.
> > 
> > Now we can remove unnecessary inet6_destroy_sock() calls in
> > sk->sk_prot->destroy().
> > 
> > DCCP and SCTP have their own sk->sk_destruct() function, so we
> > change them separately in the following patches.
> > 
> > Signed-off-by: Kuniyuki Iwashima <kuniyu@...zon.com>
> > ---
> > Cc: Mat Martineau <mathew.j.martineau@...ux.intel.com>
> > Cc: Matthieu Baerts <matthieu.baerts@...sares.net>
> 
> Thank you for the cc!
> Please next time also cc MPTCP ML if you don't mind.

Sure!


> 
> (...)
> 
> > diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> > index f599ad44ed24..7cc9c542c768 100644
> > --- a/net/mptcp/protocol.c
> > +++ b/net/mptcp/protocol.c
> > @@ -17,9 +17,6 @@
> >  #include <net/protocol.h>
> >  #include <net/tcp.h>
> >  #include <net/tcp_states.h>
> > -#if IS_ENABLED(CONFIG_MPTCP_IPV6)
> > -#include <net/transp_v6.h>
> > -#endif
> 
> Please keep this include: it is needed to access "tcpv6_prot" (as
> reported by the kernel bot).

Will add it back in v2.

I wonder why allmodconfig couldn't catch this and noticed MPTCP
cannot be modulised.
I'll test all(yes|mod|no)config from next time :)


> 
> >  #include <net/mptcp.h>
> >  #include <net/xfrm.h>
> >  #include <asm/ioctls.h>
> > @@ -3898,12 +3895,6 @@ static const struct proto_ops mptcp_v6_stream_ops = {
> >  
> >  static struct proto mptcp_v6_prot;
> >  
> > -static void mptcp_v6_destroy(struct sock *sk)
> > -{
> > -	mptcp_destroy(sk);
> > -	inet6_destroy_sock(sk);
> > -}
> > -
> >  static struct inet_protosw mptcp_v6_protosw = {
> >  	.type		= SOCK_STREAM,
> >  	.protocol	= IPPROTO_MPTCP,
> > @@ -3919,7 +3910,6 @@ int __init mptcp_proto_v6_init(void)
> >  	mptcp_v6_prot = mptcp_prot;
> >  	strcpy(mptcp_v6_prot.name, "MPTCPv6");
> >  	mptcp_v6_prot.slab = NULL;
> > -	mptcp_v6_prot.destroy = mptcp_v6_destroy;
> >  	mptcp_v6_prot.obj_size = sizeof(struct mptcp6_sock);
> >  
> >  	err = proto_register(&mptcp_v6_prot, 1);
> 
> I see that for MPTCP IPv6 sockets, sk->sk_destruct is now set to
> inet6_sock_destruct() which calls inet6_destroy_sock() via
> inet6_cleanup_sock().
> 
> So all good for the MPTCP part (if you re-add the include ;) ).

Thank you!


> 
> Cheers,
> Matt
> -- 
> Tessares | Belgium | Hybrid Access Solutions
> www.tessares.net

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ