RDMA: Directly cast the sockaddr union to sockaddr
authorJason Gunthorpe <jgg@mellanox.com>
Mon, 13 May 2019 00:57:57 +0000 (21:57 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Jul 2019 11:14:49 +0000 (13:14 +0200)
commit89c49e7b6b0a3d8073969af3f871572cd42820c8
tree7dc2e0a2d90318114eb46c0ea9a20aa4ba62721d
parenta319c8ff4f09cae9936385a9297b1b29165e2d8c
RDMA: Directly cast the sockaddr union to sockaddr

commit 641114d2af312d39ca9bbc2369d18a5823da51c6 upstream.

gcc 9 now does allocation size tracking and thinks that passing the member
of a union and then accessing beyond that member's bounds is an overflow.

Instead of using the union member, use the entire union with a cast to
get to the sockaddr. gcc will now know that the memory extends the full
size of the union.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/core/addr.c
drivers/infiniband/hw/ocrdma/ocrdma_ah.c
drivers/infiniband/hw/ocrdma/ocrdma_hw.c