summaryrefslogtreecommitdiff
path: root/net/ipv6/exthdrs.c
diff options
context:
space:
mode:
authorVadim Fedorenko <vadfed@meta.com>2024-02-13 14:04:28 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-12-14 21:59:35 +0300
commit19a788bd40fd5d3596e12ab01d0917d0f0fd3115 (patch)
tree6ebce3aa4f78b1d44417b478283aa1f9bd05e3cc /net/ipv6/exthdrs.c
parent4d5a573f64e85ca65e23667f638131fb71995fed (diff)
downloadlinux-19a788bd40fd5d3596e12ab01d0917d0f0fd3115.tar.xz
net-timestamp: make sk_tskey more predictable in error path
[ Upstream commit 488b6d91b07112eaaaa4454332c1480894d4e06e ] When SOF_TIMESTAMPING_OPT_ID is used to ambiguate timestamped datagrams, the sk_tskey can become unpredictable in case of any error happened during sendmsg(). Move increment later in the code and make decrement of sk_tskey in error path. This solution is still racy in case of multiple threads doing snedmsg() over the very same socket in parallel, but still makes error path much more predictable. Fixes: 09c2d251b707 ("net-timestamp: add key to disambiguate concurrent datagrams") Reported-by: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Vadim Fedorenko <vadfed@meta.com> Reviewed-by: Willem de Bruijn <willemb@google.com> Link: https://lore.kernel.org/r/20240213110428.1681540-1-vadfed@meta.com Signed-off-by: Paolo Abeni <pabeni@redhat.com> Stable-dep-of: 3301ab7d5aeb ("net/ipv6: release expired exception dst cached in socket") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/ipv6/exthdrs.c')
0 files changed, 0 insertions, 0 deletions