Commit 642212a5 authored by Eric Dumazet's avatar Eric Dumazet Committed by Yongqiang Liu
Browse files

inet: read sk->sk_family once in inet_recv_error()

stable inclusion
from stable-v4.19.307
commit caa064c3c2394d03e289ebd6b0be5102eb8a5b40
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I970CO


CVE: NA

--------------------------------

[ Upstream commit eef00a82c568944f113f2de738156ac591bbd5cd ]

inet_recv_error() is called without holding the socket lock.

IPv6 socket could mutate to IPv4 with IPV6_ADDRFORM
socket option and trigger a KCSAN warning.

Fixes: f4713a3d ("net-timestamp: make tcp_recvmsg call ipv6_recv_error for AF_INET6 socks")
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Reviewed-by: default avatarWillem de Bruijn <willemb@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
parent e5056f3b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment