Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp851238ybi; Fri, 12 Jul 2019 05:42:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqwj/dLLG/8VcK3fX3CCh6Zr+2cY1hwucFp6xvyklqCmAi7N0+Fw6MKwWyKAOKF5dJOUMWTs X-Received: by 2002:a63:553:: with SMTP id 80mr10984562pgf.280.1562935347220; Fri, 12 Jul 2019 05:42:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562935347; cv=none; d=google.com; s=arc-20160816; b=ND2OPj8P/DdLKeIEYUOwaCxzFCEM5RflQmWFmM8ULXkfYjDZBGp5mF0ItCZ1XLB0zf 27+O11lFEPU7NQpNXc42Aj3ftd9wb9i8q5ljhE0PSsW5tZoKOJGAaslcpc0PRvuN2CSV JKY3pxr2uhchZlRg44qHqk01wShUbNWxKv5iyn/ANGxXv3zoe1HZtd744lPvxr2nKnop ECN9ap92xFfVKmHGp45+Di4Tq+d6a54OyZhEvxUcJLWJNTPnXC05WiJ48J+WyuGRXj86 HVIQhN32uLPT3dalSve4GaoNBYXI0NrxoFfvSj/cFohILlmT8Z4M6BsIXRMZHdDybh41 HWMg== 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=kP807waHwVxUpUyV/cBs+lpjXxDC7jHkBUQnbODATBQ=; b=osR23B3me15GpvYQ7edoHxMGnzyJUxqyuUGdD+eBu024FhW2WxfLmUecBtKeEVHomW ZngW1vDCe8APw2+0SEVMTVToBDlvJE0wtBM7hC3oAVopOmnFVDTNUumKDcAyZhqMB+sb mZHvTTkFzD0L/E4MexcjgqcNOHv37DooVKcHn3KXfjCug4Xja45uUSujCxjvFHDaDQlL ckz4KUJYbezAyOwh3yQEet+cSLhI5oYMR7Lm5l8gd4u/L4oGDKj9wijTya33rqN7mZdH pRQFDo6dpC9EFW/uy/+HZnU2qE9eqDwhQUDBHAQGkZWOTYvOpWewXmldzLphDbhrQzg+ 8DSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UjfeXsYl; 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 m129si8564573pfm.15.2019.07.12.05.42.12; Fri, 12 Jul 2019 05:42:27 -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=@kernel.org header.s=default header.b=UjfeXsYl; 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 S1727546AbfGLMj5 (ORCPT + 99 others); Fri, 12 Jul 2019 08:39:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:37134 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728419AbfGLM0N (ORCPT ); Fri, 12 Jul 2019 08:26:13 -0400 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 7034A2084B; Fri, 12 Jul 2019 12:26:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562934372; bh=a1KIzy7Wcu8S/Fm6g0S8WiJ+h5aYZSnv4ONmq40IDoA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UjfeXsYlmAY8W4whSqS44vR9GIL9IgHPA171XTXK6L0Sx9fQgl5KLzc/h6TM4SW3R TT3GGKC22QJcfjDK7jydKk0xX5B0jWFwrRu+CYh1bBsgFN1Cf/P+Tv0k/miXPva1TV P6ijyt3phONyew3N50w/TIZMs81bp9HqSJjsZ1Ow= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jia-Ju Bai , Luca Coelho , Kalle Valo , Sasha Levin Subject: [PATCH 5.1 027/138] iwlwifi: Fix double-free problems in iwl_req_fw_callback() Date: Fri, 12 Jul 2019 14:18:11 +0200 Message-Id: <20190712121629.743065819@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190712121628.731888964@linuxfoundation.org> References: <20190712121628.731888964@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 [ Upstream commit a8627176b0de7ba3f4524f641ddff4abf23ae4e4 ] In the error handling code of iwl_req_fw_callback(), iwl_dealloc_ucode() is called to free data. In iwl_drv_stop(), iwl_dealloc_ucode() is called again, which can cause double-free problems. To fix this bug, the call to iwl_dealloc_ucode() in iwl_req_fw_callback() is deleted. This bug is found by a runtime fuzzing tool named FIZZER written by us. Signed-off-by: Jia-Ju Bai Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c index 689a65b11cc3..4fd1737d768b 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c @@ -1579,7 +1579,6 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context) goto free; out_free_fw: - iwl_dealloc_ucode(drv); release_firmware(ucode_raw); out_unbind: complete(&drv->request_firmware_complete); -- 2.20.1