Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp1223493img; Fri, 22 Mar 2019 19:39:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqwDI/MFkyeYr7UbR1Lnudsoq7Pvb3K8nijA6wf+jMQrbGF1/E5WjjVAtIb29wKuIUy8yGUb X-Received: by 2002:a65:47cb:: with SMTP id f11mr12119602pgs.18.1553308799602; Fri, 22 Mar 2019 19:39:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553308799; cv=none; d=google.com; s=arc-20160816; b=JLj0mJmKgq3ttK2/2c7dBrukWuemYq33mzpIQmdwep4/kD/mpBQqDPHcbtToLKjspk F128lSbZEYisOUQx8fRB069bNbLsNyKpAiSZFuLjnRVutEKTCMp1x28zsvIEKH6yd2Vq /rpLkh3oe4ZGZyfpcg6yCFqSkhdKCWNPYoSNuMqobV1Isbi+LPgvpc7cToeqt49wvcLn 1VJasLWV2AyQTnU++LYYXO6/QN9h9Hy7rfkvPs+hF+TVyqNYH1eFz1la5LGM4pPKoLnz mxbbEEZyynrktZX7xAhlfIm8ClqM83J5f4kTnyRkznPxIg6vDebZbaoC4P6FO+6WBFM7 VW1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=hRLDp3eHP1YQunU1bMGe9cTpfaI5PpR1Bh0ZyFSjAi0=; b=IUoLxDTVEhzQrGVw+bF7i082irKlRdxqCg7HsX5grCxaunhKS9gO5jNu9pfg60QRhs SKgOlGMkQ0OYpZN15JHpMHJH7HMxrJeqSC9TwNxAG0vX3TFN3QEBZjrU/STPsupoLcYC OYp4PMQRXZYv0BY8Y02TYNWRAu0EbUvGOSnZJtaWWsD4XOXn/8b2UzX74o0P84OsFjQl ZKtKMTPvUWQWh9HXbw7VTGkVDRlZ7DjTdChPcTg7NzKLtZ7KionmEPjMW4wSWRiWlgen NwMR8S1iUEM/PkGyTnXUTNn2Wp5X+Zrh6mvFU87IeKi0L+OYcCGrtHSjrm7MfgSuzO9H Ug8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@umn.edu header.s=google header.b=pQ7uV6On; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=umn.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t15si7852165pgv.503.2019.03.22.19.39.43; Fri, 22 Mar 2019 19:39:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@umn.edu header.s=google header.b=pQ7uV6On; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=umn.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728175AbfCWCht (ORCPT + 99 others); Fri, 22 Mar 2019 22:37:49 -0400 Received: from mta-p6.oit.umn.edu ([134.84.196.206]:50360 "EHLO mta-p6.oit.umn.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727363AbfCWChs (ORCPT ); Fri, 22 Mar 2019 22:37:48 -0400 Received: from localhost (unknown [127.0.0.1]) by mta-p6.oit.umn.edu (Postfix) with ESMTP id 5A29BCF9 for ; Sat, 23 Mar 2019 02:37:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at umn.edu Received: from mta-p6.oit.umn.edu ([127.0.0.1]) by localhost (mta-p6.oit.umn.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jjvYXlGhK-iM for ; Fri, 22 Mar 2019 21:37:47 -0500 (CDT) Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mta-p6.oit.umn.edu (Postfix) with ESMTPS id 0F9B514E for ; Fri, 22 Mar 2019 21:37:47 -0500 (CDT) Received: by mail-pg1-f200.google.com with SMTP id o4so3808629pgl.6 for ; Fri, 22 Mar 2019 19:37:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umn.edu; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=hRLDp3eHP1YQunU1bMGe9cTpfaI5PpR1Bh0ZyFSjAi0=; b=pQ7uV6Onsfx0GT3rJP1LQ4ZM1iZvpmSIlziGNJZWzxHP3pMXGMlwPLEtbhl/pf44G6 aENWs/U+oBdk5oAi6l2+LfFk+OOya0osA7+7jP8JbHpJ/wKuA1PmFDEuikZuMn3831ic s9Ys4CBdP4HbFLR+QJvgwXT9SXtZDvFgaKtJxhGBTmYwbnrHE9y7maG+lSbPcRGvFEho c+gbVjOcNg0QF/G0qKkxzh1ColuqH1H0d8GlyqnLNv4+fhR0IjnWnn6/hnIuNvJR0ynn un49BNn0BujlnTzUiGRMdm7upJ96+xuVFGHeAd9HbMnk3SimLAyNW+UHy/ykydWtMHxN sB4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=hRLDp3eHP1YQunU1bMGe9cTpfaI5PpR1Bh0ZyFSjAi0=; b=osqagFnfSyHqyE2UiPIteyI4N2cU1XwT9ixxFDGY/oWt74EuPRYqHXVMu8MLy67mxD oeI7jLAFCHTv5znCr29weyLcg818bUYP0hIg72vSJJ9aceReVWqAkjADJI78a7MixmjT MlBnwP+k47H2dVkAWCZNxnsynp0gj6ztTgkLZJWa4P5mVLmENBLWDLXzTbCivlAA3TJJ WR/arUUVE25hbH8WGTTlOJHSVObhXhN6jUSJI6WOO4bJqXpMWhfJKOr6XZkmeWcITvzl 0xYLw4CuSeek2IRNISF1pPFRRGN6ljj311PkQvF7QzJA/MQqFDqJOZKTPnq921C9PwgK aoKw== X-Gm-Message-State: APjAAAV1BQJ+jFhfGc3mRIxcIhH1wixMKcNiLN6whbyno6nHOjLHubfB lrE1clWPIKeX93gb7THjqPuoR5MCX1rWOWSkIj8FjSxOh5B+Xn14gJaPEj4gUB8CA1nRlEBDsIe xXDuWA7zVy8k1dJgpWSnvnTJZVEge X-Received: by 2002:a63:c511:: with SMTP id f17mr12010067pgd.202.1553308666333; Fri, 22 Mar 2019 19:37:46 -0700 (PDT) X-Received: by 2002:a63:c511:: with SMTP id f17mr12010062pgd.202.1553308666135; Fri, 22 Mar 2019 19:37:46 -0700 (PDT) Received: from [10.184.4.71] (host-173-230-104-21.mnmigsc.mn.minneapolis.us.clients.pavlovmedia.net. [173.230.104.21]) by smtp.gmail.com with ESMTPSA id e123sm12644866pfe.35.2019.03.22.19.37.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Mar 2019 19:37:45 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: [PATCH] infiniband: cxgb4: fix a potential NULL pointer dereference From: Kangjie Lu In-Reply-To: <20190309051921.15212-1-kjlu@umn.edu> Date: Fri, 22 Mar 2019 21:37:46 -0500 Cc: pakki001@umn.edu, Steve Wise , Doug Ledford , Jason Gunthorpe , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20190309051921.15212-1-kjlu@umn.edu> To: kjlu@umn.edu X-Mailer: Apple Mail (2.3445.102.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Mar 8, 2019, at 11:19 PM, Kangjie Lu wrote: >=20 > get_skb may fail and return NULL. The fix returns "ENOMEM" > when it fails to avoid NULL dereference. >=20 > Signed-off-by: Kangjie Lu > --- > drivers/infiniband/hw/cxgb4/cm.c | 3 +++ > 1 file changed, 3 insertions(+) >=20 > diff --git a/drivers/infiniband/hw/cxgb4/cm.c = b/drivers/infiniband/hw/cxgb4/cm.c > index 8221813219e5..502a54d57e2c 100644 > --- a/drivers/infiniband/hw/cxgb4/cm.c > +++ b/drivers/infiniband/hw/cxgb4/cm.c > @@ -1919,6 +1919,9 @@ static int send_fw_act_open_req(struct c4iw_ep = *ep, unsigned int atid) > int win; >=20 > skb =3D get_skb(NULL, sizeof(*req), GFP_KERNEL); > + if (!skb) > + return -ENOMEM; > + Can someone review this patch? Thanks. > req =3D __skb_put_zero(skb, sizeof(*req)); > req->op_compl =3D htonl(WR_OP_V(FW_OFLD_CONNECTION_WR)); > req->len16_pkd =3D = htonl(FW_WR_LEN16_V(DIV_ROUND_UP(sizeof(*req), 16))); > --=20 > 2.17.1 >=20