summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMarc Dionne <marc.dionne@auristor.com>2019-12-09 18:04:43 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-01-09 12:19:43 +0300
commit79ce91d278498c3445a8d7007fa4dca82148edce (patch)
tree73e8ba1b5da077a80730f080bccea2e5fb16c1f2 /tools
parent33191a1bd6327e20b074dae2d9f997543092f485 (diff)
downloadlinux-79ce91d278498c3445a8d7007fa4dca82148edce.tar.xz
afs: Fix afs_find_server lookups for ipv4 peers
[ Upstream commit 9bd0160d12370a076e44f8d1320cde9c83f2c647 ] afs_find_server tries to find a server that has an address that matches the transport address of an rxrpc peer. The code assumes that the transport address is always ipv6, with ipv4 represented as ipv4 mapped addresses, but that's not the case. If the transport family is AF_INET, srx->transport.sin6.sin6_addr.s6_addr32[] will be beyond the actual ipv4 address and will always be 0, and all ipv4 addresses will be seen as matching. As a result, the first ipv4 address seen on any server will be considered a match, and the server returned may be the wrong one. One of the consequences is that callbacks received over ipv4 will only be correctly applied for the server that happens to have the first ipv4 address on the fs_addresses4 list. Callbacks over ipv4 from all other servers are dropped, causing the client to serve stale data. This is fixed by looking at the transport family, and comparing ipv4 addresses based on a sockaddr_in structure rather than a sockaddr_in6. Fixes: d2ddc776a458 ("afs: Overhaul volume and server record caching and fileserver rotation") Signed-off-by: Marc Dionne <marc.dionne@auristor.com> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions