Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6550325ybx; Mon, 11 Nov 2019 10:47:57 -0800 (PST) X-Google-Smtp-Source: APXvYqweZ9y7XbYFvj4YwEx6Kp4cMlfipDANv9jSQKMuyRNtSz8o0dFc8ziAnDpRYdC0PJ5jF7sR X-Received: by 2002:aa7:cf97:: with SMTP id z23mr28308390edx.245.1573498076975; Mon, 11 Nov 2019 10:47:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573498076; cv=none; d=google.com; s=arc-20160816; b=g5Tf7mHltHItaW/EM3W6LvRjOiK1rnp9attoTHcV8VD2SsH9VFI9AEs66KOBwRiJfp oh6RP3klnC03bWI6Z0ib5F4CNTpGVQORruYQyG6zwA8ZXOMgm+8HuRHtS90DR67FpVSp NqyKgNfGcBop7OBxTp7Mswh1N+56Y0hLZ9w1RmnwO1lqhutJjAOPpRZeV1p5wIJegiTM bdSWwhREyHoYqi0K220P4AXaDgimpeDqnTN5+lFIKxwPgEwotwDFXc2VTVjRtGJt9+au T1MbNTBvfbqB2+o1aQRoht5VOb3Pl/AFVH1MSJ3yQI0+ZKaUtnqyK3X9O96VcOog7ydj vOFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=sIOd2P7LZdMJz44hw7w0E82FScuyp5kttJgZ0mTKC2Q=; b=zDKHX8cZFFHj5szM0yi4ITmFwYOYXtOTjWrRBVnQg3R42GQz4XFKqevSNlVum2KnDh humf5PbpdgjQmHVZPB/d/KJY0ONTjFrs+V2JeXwjI8nTN1CWw74I7Jm9QJHMKx+ccW+5 49XhnSCeJUnFuYVeEIiUyIX1ToHOR23U3oNfKe9WAdh3xSpjveFdRxZ55InPikMsxZ2j BXobz9BZVvQi37oWovfp/4wBrrKoDAydrD/qcDtZOHYxrDEKy89l7TPaxc440qwiWB8H dwM6QFenq+0+2fCQUjaGCztEuL+4wr11Dq/3rFoAGsttUhT2zm32cFNTrenMu7Bs69p8 Xyyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=omRrHFcE; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c15si10217463ejd.74.2019.11.11.10.47.31; Mon, 11 Nov 2019 10:47:56 -0800 (PST) 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=@kernel.org header.s=default header.b=omRrHFcE; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729892AbfKKSpj (ORCPT + 99 others); Mon, 11 Nov 2019 13:45:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:37806 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727604AbfKKSph (ORCPT ); Mon, 11 Nov 2019 13:45:37 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 5BD3721655; Mon, 11 Nov 2019 18:45:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573497936; bh=QHCAE8wcd+eUWvHI/MkRAuR6ExGyCldnFm1jA+UqBeM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=omRrHFcESe4LKiqAzV+tkfE9caY/JiUWw2oCIVvpBgXyhUjCIScv7lp3NH0L3Vre5 ale6fTw0MyoseRzdIbTJXHGYwB8LenQyyvLgzmGCtraO+OOOjcvD6AP7IiNKvxS1tk dHfvZn2tCilnRv06HQvWpv4o0p15gV+hNN+tpz/g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dakshaja Uppalapati , Potnuri Bharat Teja , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.19 101/125] RDMA/iw_cxgb4: Avoid freeing skb twice in arp failure case Date: Mon, 11 Nov 2019 19:29:00 +0100 Message-Id: <20191111181453.391163410@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111181438.945353076@linuxfoundation.org> References: <20191111181438.945353076@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Potnuri Bharat Teja [ Upstream commit d4934f45693651ea15357dd6c7c36be28b6da884 ] _put_ep_safe() and _put_pass_ep_safe() free the skb before it is freed by process_work(). fix double free by freeing the skb only in process_work(). Fixes: 1dad0ebeea1c ("iw_cxgb4: Avoid touch after free error in ARP failure handlers") Link: https://lore.kernel.org/r/1572006880-5800-1-git-send-email-bharat@chelsio.com Signed-off-by: Dakshaja Uppalapati Signed-off-by: Potnuri Bharat Teja Reviewed-by: Jason Gunthorpe Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/cxgb4/cm.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c index 566bfcc6add0d..a5ff1f0f2073e 100644 --- a/drivers/infiniband/hw/cxgb4/cm.c +++ b/drivers/infiniband/hw/cxgb4/cm.c @@ -493,7 +493,6 @@ static int _put_ep_safe(struct c4iw_dev *dev, struct sk_buff *skb) ep = *((struct c4iw_ep **)(skb->cb + 2 * sizeof(void *))); release_ep_resources(ep); - kfree_skb(skb); return 0; } @@ -504,7 +503,6 @@ static int _put_pass_ep_safe(struct c4iw_dev *dev, struct sk_buff *skb) ep = *((struct c4iw_ep **)(skb->cb + 2 * sizeof(void *))); c4iw_put_ep(&ep->parent_ep->com); release_ep_resources(ep); - kfree_skb(skb); return 0; } -- 2.20.1