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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220711084202.GO566407@gauss3.secunet.de>
Date:   Mon, 11 Jul 2022 10:42:02 +0200
From:   Steffen Klassert <steffen.klassert@...unet.com>
To:     Sewook Seo <ssewook@...il.com>
CC:     Sewook Seo <sewookseo@...gle.com>,
        Linux Network Development Mailing List 
        <netdev@...r.kernel.org>,
        "David S . Miller " <davem@...emloft.net>,
        "Hideaki YOSHIFUJI" <yoshfuji@...ux-ipv6.org>,
        David Ahern <dsahern@...nel.org>,
        "Jakub Kicinski" <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Maciej Żenczykowski <maze@...gle.com>,
        Eric Dumazet <edumazet@...gle.com>,
        Sehee Lee <seheele@...gle.com>
Subject: Re: [PATCH v5 net-next] net: Find dst with sk's xfrm policy not
 ctl_sk

On Thu, Jul 07, 2022 at 10:01:39AM +0000, Sewook Seo wrote:
> From: sewookseo <sewookseo@...gle.com>
> 
> If we set XFRM security policy by calling setsockopt with option
> IPV6_XFRM_POLICY, the policy will be stored in 'sock_policy' in 'sock'
> struct. However tcp_v6_send_response doesn't look up dst_entry with the
> actual socket but looks up with tcp control socket. This may cause a
> problem that a RST packet is sent without ESP encryption & peer's TCP
> socket can't receive it.
> This patch will make the function look up dest_entry with actual socket,
> if the socket has XFRM policy(sock_policy), so that the TCP response
> packet via this function can be encrypted, & aligned on the encrypted
> TCP socket.
> 
> Tested: We encountered this problem when a TCP socket which is encrypted
> in ESP transport mode encryption, receives challenge ACK at SYN_SENT
> state. After receiving challenge ACK, TCP needs to send RST to
> establish the socket at next SYN try. But the RST was not encrypted &
> peer TCP socket still remains on ESTABLISHED state.
> So we verified this with test step as below.
> [Test step]
> 1. Making a TCP state mismatch between client(IDLE) & server(ESTABLISHED).
> 2. Client tries a new connection on the same TCP ports(src & dst).
> 3. Server will return challenge ACK instead of SYN,ACK.
> 4. Client will send RST to server to clear the SOCKET.
> 5. Client will retransmit SYN to server on the same TCP ports.
> [Expected result]
> The TCP connection should be established.
> 
> Cc: Maciej Żenczykowski <maze@...gle.com>
> Cc: Eric Dumazet <edumazet@...gle.com>
> Cc: Steffen Klassert <steffen.klassert@...unet.com>
> Cc: Sehee Lee <seheele@...gle.com>
> Signed-off-by: Sewook Seo <sewookseo@...gle.com>

I'm ok with this from the XFRM point of view, but
can't speak for TCP.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ