]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
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)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 10 Aug 2022 07:24:30 +0000 (09:24 +0200)
commit02278d98591c65189163773e1305d184a6c5f12a
tree96f137e2aa55562a89a3b031d93335e41a5f9034
parent23a402dbea768b7d2d9b534ee866a11228ad6203
sctp: read sk->sk_bound_dev_if once in sctp_rcv()

BugLink: https://bugs.launchpad.net/bugs/1981864
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
net/sctp/input.c