diff options
author | Vadim Fedorenko <vadfed@meta.com> | 2024-02-13 03:04:28 -0800 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2024-02-15 12:04:04 +0100 |
commit | 488b6d91b07112eaaaa4454332c1480894d4e06e (patch) | |
tree | 3dc7052af956c4df9e8de2353d41061a11c8d619 /drivers | |
parent | 2ec197fda25f57afccac7f2846e509471488614c (diff) | |
download | linux-stable-488b6d91b07112eaaaa4454332c1480894d4e06e.tar.gz linux-stable-488b6d91b07112eaaaa4454332c1480894d4e06e.tar.bz2 linux-stable-488b6d91b07112eaaaa4454332c1480894d4e06e.zip |
net-timestamp: make sk_tskey more predictable in error path
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>
Diffstat (limited to 'drivers')
0 files changed, 0 insertions, 0 deletions