OSDN Git Service

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>
Sun, 11 Aug 2019 10:22:14 +0000 (12:22 +0200)
commit7d5750c0edfe886dbdee189f0c86e95c68147781
treed693d37138ac1e50e6e9714b2410d95a15813158
parent41052c98e41f8b5f31425919284ec36996ad895b
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