RDMA/rxe - Respond to skb_clone failure in rxe_recv.c
Subsystems (2)
PATCH 1/1 RDMA/rxe - Respond to skb_clone failure in rxe_recv.c
If skb_clone is unable to allocate memory for a new sk_buff this is not detected by the current code.
Check for a NULL return and continue. This is similar to other errors in this loop over QPs attached to the multicast address and consistent with the unreliable UD transport.
--- drivers/infiniband/sw/rxe/rxe_recv.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/infiniband/sw/rxe/rxe_recv.c +3 -0
@@ -271,6 +271,9 @@ static void rxe_rcv_mcast_pkt(struct rxe_dev *rxe, struct sk_buff *skb)else per_qp_skb = skb; +if (unlikely (!per_qp_skb)) +continue ; + per_qp_pkt =SKB_TO_PKT (per_qp_skb); per_qp_pkt->qp = qp;rxe_add_ref (qp);
Signature · 1 line
2.25.1
Zhu Yanjun
maintainerQuoted 9 lines · Bob Pearson
If
skb_cloneis unable to allocate memory for a newsk_buffthis is not detected by the current code.Check for a NULL return and continue. This is similar to other errors in this loop over QPs attached to the multicast address and consistent with the unreliable UD transport.
Fixes e7ec96fc7932f ("RDMA/rxe: Fix skb lifetime in rxe_rcv_mcast_pkt()")
Addresses-Coverity-ID: 1497804: Null pointer dereferences (NULL_RETURNS)
Thanks
Zhu Yanjun
Quoted 22 lines
Signed-off-by Bob Pearson <[email protected]>--- drivers/infiniband/sw/rxe/rxe_recv.c | 3 +++ 1 file changed, 3 insertions(+)drivers/infiniband/sw/rxe/rxe_recv.c +3
-1@@ -271,6 +271,9 @@ static void rxe_rcv_mcast_pkt(struct rxe_dev *rxe, struct sk_buff *skb)else per_qp_skb = skb; +if (unlikely (!per_qp_skb)) +continue ; + per_qp_pkt =SKB_TO_PKT (per_qp_skb); per_qp_pkt->qp = qp;rxe_add_ref (qp); --2.25.1
Jason Gunthorpe
maintainerQuoted 7 lines · Bob Pearson
If
skb_cloneis unable to allocate memory for a newsk_buffthis is not detected by the current code.Check for a NULL return and continue. This is similar to other errors in this loop over QPs attached to the multicast address and consistent with the unreliable UD transport.
Quoted 5 lines
Fixes e7ec96fc7932f ("RDMA/rxe: Fix skb lifetime in rxe_rcv_mcast_pkt()")Signed-off-by Bob Pearson <[email protected]>--- drivers/infiniband/sw/rxe/rxe_recv.c | 3 +++ 1 file changed, 3 insertions(+)
Subject should be 'RDMA/rxe:' not '-'
Place () after function names for clarity
Flow text to the full 76 lines
I fixed it all up and applied to for-next
Thanks,
Jason