Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 35724bcc authored by Wei Wang's avatar Wei Wang Committed by Dmitry Shmidt
Browse files

BACKPORT: tcp: fix potential double free issue for fastopen_req



commit 7db92362d2fee5887f6b0c41653b8c9f8f5d6020 upstream.

tp->fastopen_req could potentially be double freed if a malicious
user does the following:
1. Enable TCP_FASTOPEN_CONNECT sockopt and do a connect() on the socket.
2. Call connect() with AF_UNSPEC to disconnect the socket.
3. Make this socket a listening socket by calling listen().
4. Accept incoming connections and generate child sockets. All child
   sockets will get a copy of the pointer of fastopen_req.
5. Call close() on all sockets. fastopen_req will get freed multiple
   times.

Fixes: 19f6d3f3c842 ("net/tcp-fastopen: Add new API support")
Reported-by: default avatarAndrey Konovalov <andreyknvl@google.com>
Signed-off-by: default avatarWei Wang <weiwan@google.com>
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>

Change-Id: I6bb174d6997470643df5ba34e1f9858e16f4989d
Fixes: Change-Id: Icc181febd74e3117c2fc835d7ed935e107b5815e
       ("BACKPORT: net/tcp-fastopen: Add new API support")
Signed-off-by: default avatarAmit Pundir <amit.pundir@linaro.org>
parent 2a5cc53e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment