sctp: read sk->sk_bound_dev_if once in sctp_rcv()
authorEric Dumazet <edumazet@google.com>
Fri, 13 May 2022 18:55:42 +0000 (11:55 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:22:59 +0000 (10:22 +0200)
commit9b01252e6c205c1e93f0fb00b6030cfa44c0e2bd
treee39f93802bf2ca81b6960ff3db9458e1001ce5fc
parentd17b01588e0cfaf69af4ed1d3b37556853538148
sctp: read sk->sk_bound_dev_if once in sctp_rcv()

[ Upstream commit a20ea298071f46effa3aaf965bf9bb34c901db3f ]

sctp_rcv() reads sk->sk_bound_dev_if twice while the socket
is not locked. Another cpu could change this field under us.

Fixes: 0fd9a65a76e8 ("[SCTP] Support SO_BINDTODEVICE socket option on incoming packets.")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Vlad Yasevich <vyasevich@gmail.com>
Cc: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/sctp/input.c