summary refs log tree commit diff
path: root/net/qrtr/qrtr.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2020-06-30 16:41:01 -0700
committerDavid S. Miller <davem@davemloft.net>2020-06-30 18:14:38 -0700
commit6a2febec338df7e7699a52d00b2e1207dcf65b28 (patch)
tree778dc294a8c0a7f9ea767ac01539b3c2e58ba490 /net/qrtr/qrtr.c
parent28541f3d324f6de1e545e2875283b6cef95c5d36 (diff)
downloadlinux-6a2febec338df7e7699a52d00b2e1207dcf65b28.tar.gz
tcp: md5: add missing memory barriers in tcp_md5_do_add()/tcp_md5_hash_key()
MD5 keys are read with RCU protection, and tcp_md5_do_add()
might update in-place a prior key.

Normally, typical RCU updates would allocate a new piece
of memory. In this case only key->key and key->keylen might
be updated, and we do not care if an incoming packet could
see the old key, the new one, or some intermediate value,
since changing the key on a live flow is known to be problematic
anyway.

We only want to make sure that in the case key->keylen
is changed, cpus in tcp_md5_hash_key() wont try to use
uninitialized data, or crash because key->keylen was
read twice to feed sg_init_one() and ahash_request_set_crypt()

Fixes: 9ea88a153001 ("tcp: md5: check md5 signature without socket lock")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/qrtr/qrtr.c')
0 files changed, 0 insertions, 0 deletions