Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3068481yba; Tue, 16 Apr 2019 04:08:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqzifuu+1j4z17fYY/DNgbMrG4cAiKWTU2ySb51d2cAoaeQg5l12TwJhmuatAxPJK4Bv9L76 X-Received: by 2002:aa7:8252:: with SMTP id e18mr80983102pfn.105.1555412928798; Tue, 16 Apr 2019 04:08:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555412928; cv=none; d=google.com; s=arc-20160816; b=I2jWNYJE72EjuO6ovFX26sBj/5u7I+Iq2d+5tTSkwozef/dAsTx7E3BpvOh5ONQlAY ikhCPwtmCOPZhTtSzsjpZY2gmQ1Ki+wIf9aYkAanRCzdgHaXi4O2yTAx8IqneoQDTkbP Nei711nNIjoxxLLjkB2K7X3M3mHlKNqLuamxYbPJ7IwaDn6J6+1Yoc1DoLEcdqmuMZer 7d0A0jdEZMHfyWqL60N4B/VPYznc9KTcJvg2jtr4ey/C0QVnViZoMR/njwpE8sxnXnyc CArR6w94fbx7v+Lde0srwm9J6PmW9zWQjRWJ1bLH76siy0KNv0A/eb1S247NBkMWufJk 8ngA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=p/1DVeUh1+wbaTkeD4iIfu4Lt2JngN88qzssmoHptQs=; b=biEFDKC6bG4tJzf2sMMFa4lbxDpB4bRXXXjmB353PUVvwwhSCT/P1hezDQ2IY/IrnO BzF7QE3OVhnLqTD6SkzvcomkXsdv5HgbC2rX3O5YZ0E3WXTnW/zHWQ6DAFzP7yaXhRnX iTaUJXj4SN8FAjKu55MOialc9AKf7zmxDuU3qikA201XdN4todcTtXCCtu6v8DPACJyz uo2JkkzX+JQ+kQiFWHsmHBO6kVNQDFVsS1TiVQ7ZKc4v8B+Jil/FFcv26EzVIaW7mRB0 M5H7IlFA+8U5NI5sO6Hz8KL3SIHYPILscec8+MU69DYKMz/fHwlM2pFrX26hME8+jntP 6otQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@Mellanox.com header.s=selector1 header.b="ELjyHWU/"; 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=mellanox.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t4si42524906pgu.544.2019.04.16.04.08.31; Tue, 16 Apr 2019 04:08:48 -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=@Mellanox.com header.s=selector1 header.b="ELjyHWU/"; 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=mellanox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728912AbfDPLG2 (ORCPT + 99 others); Tue, 16 Apr 2019 07:06:28 -0400 Received: from mail-eopbgr60068.outbound.protection.outlook.com ([40.107.6.68]:20982 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726917AbfDPLG2 (ORCPT ); Tue, 16 Apr 2019 07:06:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=p/1DVeUh1+wbaTkeD4iIfu4Lt2JngN88qzssmoHptQs=; b=ELjyHWU/4aHxPP1sMwqBn89oow++XA8wFzu/POUx/pThm7+DoaTeobifxKSaaJo/lLq8yqyjIZzJ1yr7TB+J9A2xIfmOF4s7VyaLXNAZMIT/veoSH1L+pNvszFfw0XzneIslhHc815gwyM0WHGDN7Z6PcQzJK9HVXLcDpVHVHT4= Received: from AM6PR05MB4439.eurprd05.prod.outlook.com (52.135.162.148) by AM6PR05MB5624.eurprd05.prod.outlook.com (20.178.86.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1813.11; Tue, 16 Apr 2019 11:06:22 +0000 Received: from AM6PR05MB4439.eurprd05.prod.outlook.com ([fe80::24cd:a3f1:870b:bd92]) by AM6PR05MB4439.eurprd05.prod.outlook.com ([fe80::24cd:a3f1:870b:bd92%6]) with mapi id 15.20.1813.011; Tue, 16 Apr 2019 11:06:22 +0000 From: Jason Gunthorpe To: Colin King CC: Potnuri Bharat Teja , Doug Ledford , "linux-rdma@vger.kernel.org" , "kernel-janitors@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] RDMA/cxgb4: fix null pointer dereference on alloc_skb failure Thread-Topic: [PATCH] RDMA/cxgb4: fix null pointer dereference on alloc_skb failure Thread-Index: AQHU9ERso+Yk52XNJEqqSJZt6k25ZA== Date: Tue, 16 Apr 2019 11:06:22 +0000 Message-ID: <20190416110618.GA15844@mellanox.com> References: <20190413160026.5873-1-colin.king@canonical.com> In-Reply-To: <20190413160026.5873-1-colin.king@canonical.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: DB6PR0902CA0021.eurprd09.prod.outlook.com (2603:10a6:6:2::34) To AM6PR05MB4439.eurprd05.prod.outlook.com (2603:10a6:209:43::20) authentication-results: spf=none (sender IP is ) smtp.mailfrom=jgg@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f14c9808-c01a-48b4-4519-08d6c25b8f0b x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600140)(711020)(4605104)(4618075)(2017052603328)(7193020);SRVR:AM6PR05MB5624; x-ms-traffictypediagnostic: AM6PR05MB5624: x-microsoft-antispam-prvs: x-forefront-prvs: 000947967F x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(366004)(136003)(376002)(346002)(396003)(39860400002)(199004)(189003)(7736002)(102836004)(316002)(186003)(6512007)(4326008)(81156014)(6486002)(53936002)(81166006)(8676002)(36756003)(305945005)(99286004)(6246003)(26005)(33656002)(1076003)(54906003)(6506007)(386003)(478600001)(14454004)(3846002)(76176011)(2906002)(4744005)(105586002)(6116002)(52116002)(25786009)(86362001)(6916009)(71200400001)(71190400001)(5660300002)(97736004)(229853002)(11346002)(68736007)(476003)(486006)(2616005)(256004)(446003)(106356001)(8936002)(6436002)(66066001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM6PR05MB5624;H:AM6PR05MB4439.eurprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Hw0eohQuK72iDSoD/2Zli2vbDMSuAt80tRlvi4oaNt94HI9m2y1ZjtWMqkhs9XFz759qvTdX5Vtwwn8dTGsiCyPLRf/e/W7wbDMt05+4ZP3QHlSulW/mI3jrpy5tl3iEeTqHjM+usFM0uGB6eGuFLEOM4VyxTRdDDsJvrL2UWQKsqd87UCvNavOJvMqRj3s5WR6AN67PgPjZOLykA0mogq7Z0SxOzpCgWW1XChbjT4qyNW7kQ28sj4hf+e7kxG8bqYcRRGq2aiAbK5Vt7blg0XtEb3hwq10WuSNFfXjJxib62CLIWYRPodFfdye5nzZXD+OGKk1ePBC4SWwffvEuyL0rIZZO5R7AS4sDciyO8qSv+e9zVGgkFqpqa7forC94Rb430gvEg/k3qbg0c3QhQiLUDcG4Yrvmx9IFwpG9arA= Content-Type: text/plain; charset="us-ascii" Content-ID: <3A441435B82E8A41B10EF6265175C80D@eurprd05.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: f14c9808-c01a-48b4-4519-08d6c25b8f0b X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Apr 2019 11:06:22.0399 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB5624 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 13, 2019 at 05:00:26PM +0100, Colin King wrote: > From: Colin Ian King >=20 > Currently if alloc_skb fails to allocate the skb a null skb is passed > to t4_set_arp_err_handler and this ends up dereferencing the null skb. > Avoid the null pointer dereference by checking for a null skb and > returning early. >=20 > Addresses-Coverity: ("Dereference null return") > Fixes: b38a0ad8ec11 ("RDMA/cxgb4: Set arp error handler for PASS_ACCEPT_R= PL messages") > Signed-off-by: Colin Ian King > Acked-by: Potnuri Bharat Teja > --- > drivers/infiniband/hw/cxgb4/cm.c | 2 ++ > 1 file changed, 2 insertions(+) Applied to for-next Thanks, Jason