Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3742959pxk; Tue, 29 Sep 2020 05:18:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+XS/ma/wIbjqwDXD+hPtAhGYG+hgpLKKI/yn4/68N/kRHTzAiT5GTJhWavpg3zXvMQeWp X-Received: by 2002:a17:906:a947:: with SMTP id hh7mr3415876ejb.126.1601381883911; Tue, 29 Sep 2020 05:18:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601381883; cv=none; d=google.com; s=arc-20160816; b=gsohsPdY7djPALqJEvPgEKBUeczYYPRLsEyWwxofwqzIshrrBmg23Tw8JhPtan03gB 49XlwaA653o6YUVk/mQ2HbL4BZlD6k7CA4dnH+2lon9HN74yUjiRljrQA3l2xUNZr1NL rcqchbz8U0VleVhME9gwfT5eTc1TqVcn7a5yVmszev+IU9121VY98awRbZFwfSllA6wU VkzRrx3k8V+qyRk+fhRD82ARFPESSLut+vsIUr3KAkSlt4mJCoDgX66jhBEMkvNKebBK XFhGbKvVcpLsrO0NgVlaSKoLGWPAuC7MKDJWv2Mtw16oNngT5h7UTLo2AB7CSWqtq+FU 09Bw== 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=Nu+nVGtLazc7I8KIE2/8lAPgjqT4vU4E4D1oi0Casbk=; b=PDAZ8k+fOX/sab6UsxhiKZiPbx25nDgup75Pv8AeyNhAQWjFCoFrOkQk7TbwYOV6+G 1Q6jmKtp1HOAkNAuY1Z/2l6hThoUn289lZaeZt+ZpQ7pDHiLPe13qJfxhMxofmQWDdUt 6aY4U5gN31MM+9APnJqe6hj7hYLfwrm8WOwdpzVXhn36FPaOEgIgUr6217lHAbRAgm0F JT4AeqiHs9T8crN+dbZvX5UpqRk//XHWwHDiu+YiZg2m5fu2uCvprHe/xW215RrH03ZU QIeoRboYuRFKxtnZB3OhagtcAnCSf9c22c9XA/tN2loeWMvlcfHq6SQGKHfq6nllog9S cIYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XKNPlo5p; 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 u5si2808168edy.385.2020.09.29.05.17.40; Tue, 29 Sep 2020 05:18:03 -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=XKNPlo5p; 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 S1732166AbgI2MQN (ORCPT + 99 others); Tue, 29 Sep 2020 08:16:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:55996 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730053AbgI2LhA (ORCPT ); Tue, 29 Sep 2020 07:37:00 -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 DBC9D23AFE; Tue, 29 Sep 2020 11:32:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601379176; bh=4UkWMQ5lkT97tKJhnYAj2X2rEuvziKSV5SVl6Ys3b9M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XKNPlo5piXUXnd/keJ8sVmzhCqINXT1VZEgW7NuRJ6+AITZA0kPFJR3piUrpz1C2z T+hnUik/pI7n/zfTc4S78+4LNW15cev8mHhcuNb/BF+D2KRQZfahn5hRi6cEIShQsY HijeQ2c0b2x/fkLrSbEP8qiuB6nMa9umHWFb7CoQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pan Bian , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.4 046/388] RDMA/i40iw: Fix potential use after free Date: Tue, 29 Sep 2020 12:56:17 +0200 Message-Id: <20200929110012.719349630@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929110010.467764689@linuxfoundation.org> References: <20200929110010.467764689@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: Pan Bian [ Upstream commit da046d5f895fca18d63b15ac8faebd5bf784e23a ] Release variable dst after logging dst->error to avoid possible use after free. Link: https://lore.kernel.org/r/1573022651-37171-1-git-send-email-bianpan2016@163.com Signed-off-by: Pan Bian Reviewed-by: Jason Gunthorpe Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/i40iw/i40iw_cm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/i40iw/i40iw_cm.c b/drivers/infiniband/hw/i40iw/i40iw_cm.c index b1df93b69df44..fa7a5ff498c73 100644 --- a/drivers/infiniband/hw/i40iw/i40iw_cm.c +++ b/drivers/infiniband/hw/i40iw/i40iw_cm.c @@ -2074,9 +2074,9 @@ static int i40iw_addr_resolve_neigh_ipv6(struct i40iw_device *iwdev, dst = i40iw_get_dst_ipv6(&src_addr, &dst_addr); if (!dst || dst->error) { if (dst) { - dst_release(dst); i40iw_pr_err("ip6_route_output returned dst->error = %d\n", dst->error); + dst_release(dst); } return rc; } -- 2.25.1