RDMA/rxe: Fix skb lifetime in rxe_rcv_mcast_pkt()
authorBob Pearson <rpearsonhpe@gmail.com>
Thu, 8 Oct 2020 20:36:52 +0000 (15:36 -0500)
committerJason Gunthorpe <jgg@nvidia.com>
Thu, 8 Oct 2020 23:22:11 +0000 (20:22 -0300)
commite7ec96fc7932f48a6d6cdd05bf82004a1a04285b
tree7b70c8986e112417a5e29008559eee2fa1d49c87
parent1858d98b83940f7a0132569a2cf2017a0063e5d0
RDMA/rxe: Fix skb lifetime in rxe_rcv_mcast_pkt()

The changes referenced below replaced sbk_clone)_ by taking additional
references, passing the skb along and then freeing the skb. This
deleted the packets before they could be processed and additionally
passed bad data in each packet. Since pkt is stored in skb->cb
changing pkt->qp changed it for all the packets.

Replace skb_get() by sbk_clone() in rxe_rcv_mcast_pkt() for cases where
multiple QPs are receiving multicast packets on the same address.

Delete kfree_skb() because the packets need to live until they have been
processed by each QP. They are freed later.

Fixes: 86af61764151 ("IB/rxe: remove unnecessary skb_clone")
Fixes: fe896ceb5772 ("IB/rxe: replace refcount_inc with skb_get")
Link: https://lore.kernel.org/r/20201008203651.256958-1-rpearson@hpe.com
Signed-off-by: Bob Pearson <rpearson@hpe.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/sw/rxe/rxe_recv.c