From patchwork Sun Nov 18 02:55:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 10687671 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 166D013B5 for ; Sun, 18 Nov 2018 02:59:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0506F2A1B6 for ; Sun, 18 Nov 2018 02:59:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EADE42A1BD; Sun, 18 Nov 2018 02:59:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 595102A1B6 for ; Sun, 18 Nov 2018 02:59:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725894AbeKRNOI (ORCPT ); Sun, 18 Nov 2018 08:14:08 -0500 Received: from mail-ot1-f67.google.com ([209.85.210.67]:45513 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725814AbeKRNOI (ORCPT ); Sun, 18 Nov 2018 08:14:08 -0500 Received: by mail-ot1-f67.google.com with SMTP id 32so24236897ota.12; Sat, 17 Nov 2018 18:55:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3zYmiOhJibDHi6oIA7d+rQTRoFiKcaHV5qvmDDwBZzg=; b=mfSc6B9jI7hAxZG3tIKImJlNOYPtTQzLIys1mXmnVBBnkyiEDaQ0n5I8PqEhukb7+b gt+4gBgCh3wDnTZY+uaKwqKawe44i5pjTV3sVsczyxbG+WFycV2wRNBlPO8UCF64/jJl +rYftua6ooahtay7piSiSNnXsDL/4Qko+QNPeBxczOi+OlLHUPbnN3zlBDApmsb2W41s 4Z1HsNI6PsBGT09xLgxXX/6cj/KLVsKYVZ0YYFWQnmPAM1c91vpoOdZYNNE5ObuY0fR2 DfrErbEPhdtbXScO4BYMZzON80wA9187g11BcugS7S5mONT3xUp1W+Vfo6hlClszpHDh xNLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=3zYmiOhJibDHi6oIA7d+rQTRoFiKcaHV5qvmDDwBZzg=; b=Hn2x59Ile4lgLm80dswWW5YqLHPynRMpIEF+iOj8bALzxKamxTMXbKMfV5HoGLbrk3 /AgS0RPXbBAq5JXzHzHfKEBnYAvqHx1ab+koZo/ij8vOtcE+NzQjtdHLXzEIZuZQec8y e8XhQyzZhHnFW6ErIhXFz4fNRwchZ5uewx5ItjI/ds2OI/T30YYVviYxy+pGEhfL2Pkn uJaHkYs9oyJvxNUlIlKw5uvNooaayqBLHvVG4IL7T6AX5sCbU0NosnoU1yXDd/i1gxI/ rEzl1F/BIQeUuHM6KPlzKpI5s9IkO1useJhlGbHpfDYO9QLD43Xf4sB1QZYu4O8TNTu4 9h4w== X-Gm-Message-State: AGRZ1gKMEFPDRZEbG8oSPrl7soxEHzWQolN2fTKvqOVgPFkvnz9D4skF U2lfcRmTGUHTFoOeD5Vl3Lk= X-Google-Smtp-Source: AJdET5cxUXtQK6fehmuGY05+oKPXqnsyES28vETPyN89wM4bSPpnTlSEe/bAfkaKmWv8ITt14LzRzw== X-Received: by 2002:a9d:74c3:: with SMTP id a3mr10640945otl.107.1542509720245; Sat, 17 Nov 2018 18:55:20 -0800 (PST) Received: from localhost.localdomain (cpe-24-31-245-230.kc.res.rr.com. [24.31.245.230]) by smtp.gmail.com with ESMTPSA id y204-v6sm17640377oiy.40.2018.11.17.18.55.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Nov 2018 18:55:19 -0800 (PST) From: Larry Finger To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Larry Finger , =?utf-8?q?Francisco_Machado_Magalh=C3=A3es_Neto?= , Ping-Ke Shih , Stable Subject: [PATCH 4.20] rtlwifi: Fix leak of skb when processing C2H_BT_INFO Date: Sat, 17 Nov 2018 20:55:03 -0600 Message-Id: <20181118025503.20639-1-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.16.4 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP With commit 0a9f8f0a1ba9 ("rtlwifi: fix btmpinfo timeout while processing C2H_BT_INFO"), calling rtl_c2hcmd_enqueue() with rtl_c2h_fast_cmd() true, the routine returns without freeing that skb, thereby leaking it. This issue has been discussed at https://github.com/lwfinger/rtlwifi_new/issues/401 and the fix tested there. Fixes: 0a9f8f0a1ba9 ("rtlwifi: fix btmpinfo timeout while processing C2H_BT_INFO") Reported-and-tested-by: Francisco Machado Magalhães Neto Cc: Francisco Machado Magalhães Neto Cc: Ping-Ke Shih Cc: Stable # 4.18+ Signed-off-by: Larry Finger --- drivers/net/wireless/realtek/rtlwifi/base.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c b/drivers/net/wireless/realtek/rtlwifi/base.c index f4122c8fdd97..ef9b502ce576 100644 --- a/drivers/net/wireless/realtek/rtlwifi/base.c +++ b/drivers/net/wireless/realtek/rtlwifi/base.c @@ -2289,6 +2289,7 @@ void rtl_c2hcmd_enqueue(struct ieee80211_hw *hw, struct sk_buff *skb) if (rtl_c2h_fast_cmd(hw, skb)) { rtl_c2h_content_parsing(hw, skb); + kfree_skb(skb); return; }