Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp296874yba; Sat, 4 May 2019 02:36:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqwTh302dL2Z2RjlHX5H0eK6G+1nbcIgQ6tCVFwIacO0rtBN1g59bp7FKYjR3hza63IGTNlw X-Received: by 2002:a65:610a:: with SMTP id z10mr17373027pgu.54.1556962560153; Sat, 04 May 2019 02:36:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556962560; cv=none; d=google.com; s=arc-20160816; b=WglYZn/tGEHJDO957cSsojqiRpVsdhYik/KPmXVxBTfTc6TZhnv/0FEDMhsn5gI6I3 7NsITZd7thcfFBJEIQoF3mBXi2sYAZo9BRKgqLqNrgEDfJArxWr5P/NuB5A+62KZMyeF MPocqmrZpy9bwnLnxZ9qz5TtCupqlA9p7GoCy6EgFSGAZYI9F9ySTgee9BqWO6dyELJh xAAcpUsW/0VlUmzBrOR4mbs2Bt2CsNHj31qunnqq1Rsc1XR51RWvfzejhNIz+LnIlR/s KDI1/FkOTPj7DB77Fs39W5TjaD8lqLaRu//+pgZtzGd1zfPw4j5YM3v7TppwGYQmw5oW JChA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=o4j1T5yZ8t1V9WsJtSUZ/pyrVijvIYHALD8xyZnCv2E=; b=nCF9iIT47LHDoPBsR6iO0s2VNllqfoj4QutG+YdvWQNzMt3ZeFVM3+rHqui+OQ3pCj jNCK78+Rbe6cajDeyvCK2nc8w4PcQww7THXwFHD0ZEhOhVYJH5Zg5HbVMhiwcZxEtyjy RED8oNQRruYMWT9ddA8qmpa6vFmP0gpwqV3o8pSdpu+ya21LREeuzw45O2NzHOWU5Cx3 mYlTjua++gkN/gw1Br9IwbL44NO23LTaZ+hdolfkvko1fCPTwUY2xLFK9ChY0ChkhC08 IzBd44u0W8LStXX9qgTMxpn4NWMcyVgddBVJt4/tDhy69R1/s6KZXtw/iPBR4wfWyLh3 4ewg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SDHqbOWQ; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y10si6307204pga.96.2019.05.04.02.35.30; Sat, 04 May 2019 02:36:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-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=@gmail.com header.s=20161025 header.b=SDHqbOWQ; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726215AbfEDJdQ (ORCPT + 99 others); Sat, 4 May 2019 05:33:16 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:40831 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725823AbfEDJdQ (ORCPT ); Sat, 4 May 2019 05:33:16 -0400 Received: by mail-pg1-f194.google.com with SMTP id d31so3932552pgl.7; Sat, 04 May 2019 02:33:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=o4j1T5yZ8t1V9WsJtSUZ/pyrVijvIYHALD8xyZnCv2E=; b=SDHqbOWQEYpiZtXu9miV/f1WNH8j3fcQaHDOtq5uS8LwdVNSkLhLyyx36zJAg7RCmr Inxs90oOWKzevhvzRfjiCRvTeYB34gF8BrjRgP7/TViod7RwfEnJQKWlKT8ep+mmdPwU CPNPN0j1XADrukqawuWKSDKXo+ZFysVq8G3HNEoGkFSlrwJ7f0/aFG9IhZIVcl22JeCh JYVj32eXCfvrIH8YtEoUGNLFjUaT21ibQ5OTawXZaYy5/uuwqJ9pVp92ZsoAPygPBCXB s0EDWtYiWny6ZgrmEEDVneEG5uC0rUzlVsfhH3BLAPcm47fkQ6T8KyveADPztz9Bggu7 TYHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=o4j1T5yZ8t1V9WsJtSUZ/pyrVijvIYHALD8xyZnCv2E=; b=KsG50sgGCbINc04GRIFsehsmWMc1E6tK1BsJg9k1oVs+P5KmC6hmEydEEbPGzxtgdA AO1zCG4JiTomG9+BP1ZzdHHMXMK6tyF7ZZ2d0Prp9b3Hp1wkqnz5MwLFVpr4KolHnvok 0MpKV58pXhF5shJfeTponh8rg0go25OwQ9mCDQMmBd3ddEVq/ZSJZ+pecR9Nw98wnxj2 kTTX2okVCayubyDilZ/kvk0Xeke+wkR3giW/PZQ8sRJqxxCdy32K9tLyox27sh9Oqj24 GN/IMBl4Jy+rvp8NvBVb3DxkuZb6MH7rztp13al3V9JRvfyLmKA+hjycXFHnzp7a0Pb3 YECg== X-Gm-Message-State: APjAAAUN/IjUEEUx1+x6MGMZQHK72bt6RoLs283yl7f3rVHHATmM5/tX k84E/xHwQFrgSQvV7GIgoSQ= X-Received: by 2002:a63:5057:: with SMTP id q23mr17508361pgl.30.1556962394911; Sat, 04 May 2019 02:33:14 -0700 (PDT) Received: from oslab.tsinghua.edu.cn ([2402:f000:4:72:808::3ca]) by smtp.gmail.com with ESMTPSA id j22sm6066243pfi.139.2019.05.04.02.33.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 May 2019 02:33:14 -0700 (PDT) From: Jia-Ju Bai To: johannes.berg@intel.com, emmanuel.grumbach@intel.com, luciano.coelho@intel.com, linuxwifi@intel.com, kvalo@codeaurora.org, davem@davemloft.net Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] net: wireless: iwlwifi: Fix double-free problems in iwl_req_fw_callback() Date: Sat, 4 May 2019 17:33:05 +0800 Message-Id: <20190504093305.19360-1-baijiaju1990@gmail.com> X-Mailer: git-send-email 2.17.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 --- 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.17.0