Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp282992pxx; Wed, 28 Oct 2020 04:59:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaOb+MTUyCyOCe4gHUHBHrlSt/VLcd/C0Z/R0LBtKEt3l5uZfKksK3OdN2Me1uq/g/wGpR X-Received: by 2002:aa7:d582:: with SMTP id r2mr7067233edq.170.1603886376635; Wed, 28 Oct 2020 04:59:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603886376; cv=none; d=google.com; s=arc-20160816; b=N/JGAN6EmLQmVzz36zVALjNdqOEXLwtgjhhAtdtqLGsahZ8WQbCne+I2bW7JmHuKf+ 5ebFZGEr4pE7g+AHaDVti1CQVNMQfgimSp6bM//utDQ7SNTHMv9wMohOpK4KX+vFJzFo Y3mHEPtX1SM5W9Zm1ntv4NeDMzeuqMNaI3BNMGEFjonzG70brlICGSudsssRqlSwShHl N6s2AVixS9ZcizF7EhM1FpPFfGml1ZHYkyhs2i1Hcbm9IXhlbxddqvcTc+WI2AV7yPKP UxPR5fmdbckkOzKV/qhKwef0fBr6rYs0N4iUrsYA38i5ZpoMWkaCCW39pIXbxhWELFtG t9Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fvv6j9epriKnMyOJn0xvXokRbS8oNG7sGn1v71EQtMI=; b=rT31wFgRjyLroor4XCEYNuR72UKTSAjr3rr0LtIIxK08NHiVAablFV46ogQOo4SfrM 5d9SSH5KQ/KLbszprW86Z1BSGhs3DNeLvuMrKbQcCZmzr0uG+RSdQsoHzINBEAOMmzka 6yTHcwJnltNyESrwjqHoJ+Eci8H9IH+5p1U/rFwYJw7yCv6WvdK0oGToEZipPXbheVd1 JXIOXc4oCgl35UBN4NxZ9D7aMAJkDchw9M8ihx/r6ftC9bZoggun1iM1gQlKGdoeHYxT s4/a7ziVgBOh7eVvZHWE426H6x6snqiNWL4yCMj5TCKXc1qL9kn70alnjG1mFM5L5Il8 6mPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NCqRBV2H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i19si2816688ejh.153.2020.10.28.04.59.14; Wed, 28 Oct 2020 04:59:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NCqRBV2H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1794925AbgJ0POX (ORCPT + 99 others); Tue, 27 Oct 2020 11:14:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:43818 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1793838AbgJ0PIf (ORCPT ); Tue, 27 Oct 2020 11:08:35 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F307D206E5; Tue, 27 Oct 2020 15:08:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811314; bh=6iNgf1jOVE5Jgq3YA/ekXFTlsyVoU1AiArcDjjJpnNg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NCqRBV2HPO3lZWReLe0u1j5wW2TrWTeVoNuty+XYJ2UdPC5Mn6AfUiXuymwSqj7vA 0fu1ZKxI5nEqwGHXwb2ei6/M3APxgh9+Iu4bq9S6fEBviQ4YUhKv6fR9Snl/IByUMQ NvO9EAeAqcox5sE2h/buj43gvZq+hLaguW15MNs8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bob Pearson , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.8 418/633] RDMA/rxe: Handle skb_clone() failure in rxe_recv.c Date: Tue, 27 Oct 2020 14:52:41 +0100 Message-Id: <20201027135542.330204572@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bob Pearson [ Upstream commit 71abf20b28ff87fee6951ec2218d5ce7969c4e87 ] 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. Fixes: e7ec96fc7932f ("RDMA/rxe: Fix skb lifetime in rxe_rcv_mcast_pkt()") Addresses-Coverity-ID: 1497804: Null pointer dereferences (NULL_RETURNS) Link: https://lore.kernel.org/r/20201013184236.5231-1-rpearson@hpe.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/sw/rxe/rxe_recv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/infiniband/sw/rxe/rxe_recv.c b/drivers/infiniband/sw/rxe/rxe_recv.c index be6416a982c70..9bfb98056fc2a 100644 --- a/drivers/infiniband/sw/rxe/rxe_recv.c +++ b/drivers/infiniband/sw/rxe/rxe_recv.c @@ -319,6 +319,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