From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DAD01C742BA for ; Fri, 12 Jul 2019 12:39:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AA2AD2080A for ; Fri, 12 Jul 2019 12:39:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562935196; bh=a1KIzy7Wcu8S/Fm6g0S8WiJ+h5aYZSnv4ONmq40IDoA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=wnzB9gEiztyQLUaU+NjeRRtfdBP/4v/wfhW/6KQ65YCn9q62BqVwUCQoIYFzFz+CX 68JdaywtXJzgYZwYyWGBhUhwPSMSV1jSC2zYggfsAquG8RKwrj8pczSLgApuIX8pZb IcsTx/E6jsKZxjw6h1UYshI3l3F6jpSS9tfv6KmI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728802AbfGLMjz (ORCPT ); Fri, 12 Jul 2019 08:39:55 -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: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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