From a1f67e60efa2670e838eea326fdbeff87808482a Mon Sep 17 00:00:00 2001 From: "Justin M. Forbes" Date: Thu, 21 Nov 2019 14:25:24 -0600 Subject: [PATCH] Fix a bunch of CVEs --- ...fix-memory-leak-in-crypto_reportstat.patch | 107 +++++++++++++++++ ...x-memory-leak-in-__ipmi_bmc_register.patch | 102 ++++++++++++++++ kernel.spec | 56 +++++++++ ...vent-memory-leak-in-cx23888_ir_probe.patch | 103 ++++++++++++++++ ...y-leak-in-mwifiex_pcie_init_evt_ring.patch | 111 ++++++++++++++++++ ...eak-in-mwifiex_pcie_alloc_cmdrsp_buf.patch | 109 +++++++++++++++++ ...t-memory-leak-in-i40e_setup_macvlans.patch | 80 +++++++++++++ rpmsg-char-release-allocated-memory.patch | 103 ++++++++++++++++ ...ease-skb-if-rsi_prepare_beacon-fails.patch | 101 ++++++++++++++++ rtl8xxxu-prevent-leaking-urb.patch | 101 ++++++++++++++++ ...prevent-memory-leak-in-rtl_usb_probe.patch | 110 +++++++++++++++++ ...se-allocated-memory-in-case-of-error.patch | 105 +++++++++++++++++ ...revent-memory-leak-in-spi_gpio_probe.patch | 39 ++++++ ...i-fix-memory-leak-in-fsl_lpspi_probe.patch | 105 +++++++++++++++++ 14 files changed, 1332 insertions(+) create mode 100644 crypto-user-fix-memory-leak-in-crypto_reportstat.patch create mode 100644 ipmi-Fix-memory-leak-in-__ipmi_bmc_register.patch create mode 100644 media-rc-prevent-memory-leak-in-cx23888_ir_probe.patch create mode 100644 mwifiex-pcie-Fix-memory-leak-in-mwifiex_pcie_init_evt_ring.patch create mode 100644 mwifiex-pcie-fix-memory-leak-in-mwifiex_pcie_alloc_cmdrsp_buf.patch create mode 100644 net-next-v2-9-9-i40e-prevent-memory-leak-in-i40e_setup_macvlans.patch create mode 100644 rpmsg-char-release-allocated-memory.patch create mode 100644 rsi-release-skb-if-rsi_prepare_beacon-fails.patch create mode 100644 rtl8xxxu-prevent-leaking-urb.patch create mode 100644 rtlwifi-prevent-memory-leak-in-rtl_usb_probe.patch create mode 100644 scsi-bfa-release-allocated-memory-in-case-of-error.patch create mode 100644 spi-gpio-prevent-memory-leak-in-spi_gpio_probe.patch create mode 100644 spi-lpspi-fix-memory-leak-in-fsl_lpspi_probe.patch diff --git a/crypto-user-fix-memory-leak-in-crypto_reportstat.patch b/crypto-user-fix-memory-leak-in-crypto_reportstat.patch new file mode 100644 index 000000000..8779b8565 --- /dev/null +++ b/crypto-user-fix-memory-leak-in-crypto_reportstat.patch @@ -0,0 +1,107 @@ +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.5 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, + DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, + HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, + SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable + 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 8D752C4CED1 + for ; Fri, 4 Oct 2019 19:35:05 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id 696E721D81 + for ; Fri, 4 Oct 2019 19:35:05 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KfPgoQZi" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1730579AbfJDTfE (ORCPT + ); + Fri, 4 Oct 2019 15:35:04 -0400 +Received: from mail-io1-f66.google.com ([209.85.166.66]:36406 "EHLO + mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1725932AbfJDTfE (ORCPT + ); + Fri, 4 Oct 2019 15:35:04 -0400 +Received: by mail-io1-f66.google.com with SMTP id b136so16026274iof.3; + Fri, 04 Oct 2019 12:35:03 -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=YUxdWoMjBc3fq7ZEjHVbfnvWMNYpsAW2uL8SUTPJJOk=; + b=KfPgoQZiuCc2H7qvFQGzN/Y3EGPnFsu/TLq9CSR8tecMTpa9YL5eWsqgES34oDbm/Z + tBCmz9oK9X/m4/+VrPKpX573tizGffhrsfpuA+Fq69Y2qLjGgld9HOjAHd01oZ83u+Oe + IfpTdiUjqLS2q1WMSLKP4SYO6lGOL2hAK3fuICIkeFaCYYGEBCZ2DyuGyNv2KTqUkk7I + KQb1aZ8FaukkgvjqFvRKzmxBX1EAfsP/eODyKd0CEqnIZdQbkd0Y6geyteNUOKSTNqcn + /XpZgD+IsGXz2qWx9KTOw6csMacDX9jweaZEo3BHAZO4XGnVw+LP8rKJvYE92arFNI4q + +LLA== +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=YUxdWoMjBc3fq7ZEjHVbfnvWMNYpsAW2uL8SUTPJJOk=; + b=MZTiefsa/zD0rlKyJnXaNkjhKxyXM1RPbiOfRsBzjAXppzdpVXEsMuoNuMbb7UL0XD + StXE1INBYwfkI73zbAuORpk1uc3QBCg0KUc6/FT8QWdwM6pVw3g0pWbwPcnA3YhdqbTk + 0XWZReG3dHpnGJ+HjFibx9C5K2a5pTK2zAXRfXgJvSLWuhLdI26dNRjOdqmwW02tAThC + Z86x/deIZhaQiRbpDadvJVNEx7tRQ0TT1d27Rf93LQStQ5vJW01jA5g//b8D5aB1Q4md + mqI61eE+ughOjC7Ef3gIldPML4dtt/zOjR45rFV078yk8vaefDXDqdVnXIL309NOfiRj + iGPg== +X-Gm-Message-State: APjAAAWuXZ3QkwcdijV+oJ20x5WQPqQsko2OjLI/I2ZE5tL5mXtDiZ9P + Kn6oGyHFRVspaJiNUH3WmBs= +X-Google-Smtp-Source: APXvYqxdxqTqNQ2D2g2hs/N3xw+sie1sFybvZM7Bv8s50eW0Wl4EA5uLHeMeKaifDlU11aRt9jEhKg== +X-Received: by 2002:a5d:88d1:: with SMTP id i17mr14654011iol.235.1570217702565; + Fri, 04 Oct 2019 12:35:02 -0700 (PDT) +Received: from cs-dulles.cs.umn.edu (cs-dulles.cs.umn.edu. [128.101.35.54]) + by smtp.googlemail.com with ESMTPSA id t8sm3372621ild.7.2019.10.04.12.35.01 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Fri, 04 Oct 2019 12:35:01 -0700 (PDT) +From: Navid Emamdoost +Cc: emamd001@umn.edu, kjlu@umn.edu, smccaman@umn.edu, + Navid Emamdoost , + Herbert Xu , + "David S. Miller" , + linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org +Subject: [PATCH] crypto: user - fix memory leak in crypto_reportstat +Date: Fri, 4 Oct 2019 14:34:54 -0500 +Message-Id: <20191004193455.18348-1-navid.emamdoost@gmail.com> +X-Mailer: git-send-email 2.17.1 +To: unlisted-recipients:; (no To-header on input) +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: +List-Archive: +List-Post: + +In crypto_reportstat, a new skb is created by nlmsg_new(). This skb is +leaked if crypto_reportstat_alg() fails. Required release for skb is +added. + +Fixes: cac5818c25d0 ("crypto: user - Implement a generic crypto statistics") +Signed-off-by: Navid Emamdoost +--- + crypto/crypto_user_stat.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/crypto/crypto_user_stat.c b/crypto/crypto_user_stat.c +index 8bad88413de1..1be95432fa23 100644 +--- a/crypto/crypto_user_stat.c ++++ b/crypto/crypto_user_stat.c +@@ -328,8 +328,10 @@ int crypto_reportstat(struct sk_buff *in_skb, struct nlmsghdr *in_nlh, + drop_alg: + crypto_mod_put(alg); + +- if (err) ++ if (err) { ++ kfree_skb(skb); + return err; ++ } + + return nlmsg_unicast(net->crypto_nlsk, skb, NETLINK_CB(in_skb).portid); + } +-- +2.17.1 + + diff --git a/ipmi-Fix-memory-leak-in-__ipmi_bmc_register.patch b/ipmi-Fix-memory-leak-in-__ipmi_bmc_register.patch new file mode 100644 index 000000000..779810f98 --- /dev/null +++ b/ipmi-Fix-memory-leak-in-__ipmi_bmc_register.patch @@ -0,0 +1,102 @@ +From patchwork Mon Oct 21 20:06:48 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Navid Emamdoost +X-Patchwork-Id: 1142634 +Return-Path: +Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) + by smtp.lore.kernel.org (Postfix) with ESMTP id EA234CA9EAF + for ; Mon, 21 Oct 2019 20:06:59 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id BED092084C + for ; Mon, 21 Oct 2019 20:06:59 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=fail reason="signature verification failed" (2048-bit key) + header.d=gmail.com header.i=@gmail.com header.b="X0MaxGN8" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1730272AbfJUUG6 (ORCPT + ); + Mon, 21 Oct 2019 16:06:58 -0400 +Received: from mail-io1-f68.google.com ([209.85.166.68]:34607 "EHLO + mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1729406AbfJUUG6 (ORCPT + ); + Mon, 21 Oct 2019 16:06:58 -0400 +Received: by mail-io1-f68.google.com with SMTP id q1so17550475ion.1 + for ; + Mon, 21 Oct 2019 13:06:57 -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=DIJwALRySeQ5zjngsNl1Oe1bgDriLGNlywHknPtGNKc=; + b=X0MaxGN8uxeLjYheUzuflEGcTyAqv8YypCRnHwa4mTnDTdSFogTx9CmYGVwjKjmBXc + ImeJqPHySwSBK5FlsHysS8KWszaYtbNOrRgojf/0F+/RfarheahIQiunZyUotRZ9TAof + xIVIJOh6WGISCOs5n1WzwQq1osMxUM9HEh3Szg6lGyhQQ7k6jd7Jemg1+TpOtd8USEPH + r3a/x+xk11Q/5Opu+1zLFcPL9hujVi3s+U9By+5oBW5H6sgEMiQdgX9KSjIN0fWYy6p2 + vxxpECwHW/25y9nXwmH/GJvl9MgOHRHPBm4IGzRvu6ppe9DHbvB6CFaDWsXRNxK+lzJf + Idjw== +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=DIJwALRySeQ5zjngsNl1Oe1bgDriLGNlywHknPtGNKc=; + b=j2RCkPeTaplVf86HaOq2gLcWX/ri2fSs8uSZL59RuMcUohLJhfdxMZ5PCO5yGpm3vz + 9U3Eo7NyCGuTCv+xLJvanDw5YSe+QadEz92hTBZbP5vdhYcWlT1byLjRnLXr1n3O7fvG + irPww56P/AyO4hZBMwQpJLvAcwgKYLYbUVdL2QQVAIk+RAnIfYxFEMG56H6NPDhOyDer + rmEyr3Z1yQZHEmrqPSvaYyQ5rWLgfHl9GVACAz/nNoF2+j5H7NFRWyfPFAD4qBtnaimm + GVINQdfuXGU18S4Qlt26cvs4G3kx05gVVDtEn1LYJ/Wrim1vPPalKKJ3CJtvUd6NH5pC + /jxQ== +X-Gm-Message-State: APjAAAXVQAU+1Bai+XjnGC0zCaCEr0QIS571QaPV5KbcsMXjGxIQjnYr + zFmkQrr1KoRu2rZPwhOr/yU= +X-Google-Smtp-Source: + APXvYqwEYhuc38vwAbFtVAVtw8KV1JZMFhL3O31vXn9gEH9A2rMxW/fJ2esBpTWkjZy7Hbvve2Y6Tg== +X-Received: by 2002:a02:3208:: with SMTP id j8mr93347jaa.86.1571688417041; + Mon, 21 Oct 2019 13:06:57 -0700 (PDT) +Received: from cs-dulles.cs.umn.edu (cs-dulles.cs.umn.edu. [128.101.35.54]) + by smtp.googlemail.com with ESMTPSA id + d21sm4743611iom.29.2019.10.21.13.06.56 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Mon, 21 Oct 2019 13:06:56 -0700 (PDT) +From: Navid Emamdoost +Cc: emamd001@umn.edu, kjlu@umn.edu, smccaman@umn.edu, + Navid Emamdoost , + Corey Minyard , Arnd Bergmann , + Greg Kroah-Hartman , + openipmi-developer@lists.sourceforge.net, + linux-kernel@vger.kernel.org +Subject: [PATCH] ipmi: Fix memory leak in __ipmi_bmc_register +Date: Mon, 21 Oct 2019 15:06:48 -0500 +Message-Id: <20191021200649.1511-1-navid.emamdoost@gmail.com> +X-Mailer: git-send-email 2.17.1 +To: unlisted-recipients:; (no To-header on input) +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-kernel@vger.kernel.org + +In the impelementation of __ipmi_bmc_register() the allocated memory for +bmc should be released in case ida_simple_get() fails. + +Fixes: 68e7e50f195f ("ipmi: Don't use BMC product/dev ids in the BMC name") +Signed-off-by: Navid Emamdoost +--- + drivers/char/ipmi/ipmi_msghandler.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c +index 2aab80e19ae0..e4928ed46396 100644 +--- a/drivers/char/ipmi/ipmi_msghandler.c ++++ b/drivers/char/ipmi/ipmi_msghandler.c +@@ -3031,8 +3031,11 @@ static int __ipmi_bmc_register(struct ipmi_smi *intf, + bmc->pdev.name = "ipmi_bmc"; + + rv = ida_simple_get(&ipmi_bmc_ida, 0, 0, GFP_KERNEL); +- if (rv < 0) ++ if (rv < 0) { ++ kfree(bmc); + goto out; ++ } ++ + bmc->pdev.dev.driver = &ipmidriver.driver; + bmc->pdev.id = rv; + bmc->pdev.dev.release = release_bmc_device; diff --git a/kernel.spec b/kernel.spec index c88f199a5..31da1c149 100644 --- a/kernel.spec +++ b/kernel.spec @@ -810,6 +810,46 @@ Patch504: 0001-mm-kmemleak-skip-late_init-if-not-skip-disable.patch # https://lkml.org/lkml/2019/8/29/1772 Patch505: ARM-fix-__get_user_check-in-case-uaccess_-calls-are-not-inlined.patch +# CVE-2019-19071 rhbz 1774949 1774950 +Patch509: rsi-release-skb-if-rsi_prepare_beacon-fails.patch + +# CVE-2019-19070 rhbz 1774957 1774958 +Patch510: spi-gpio-prevent-memory-leak-in-spi_gpio_probe.patch + +# CVE-2019-19068 rhbz 1774963 1774965 +Patch511: rtl8xxxu-prevent-leaking-urb.patch + +# CVE-2019-19043 rhbz 1774972 1774973 +Patch512: net-next-v2-9-9-i40e-prevent-memory-leak-in-i40e_setup_macvlans.patch + +# CVE-2019-19066 rhbz 1774976 1774978 +Patch513: scsi-bfa-release-allocated-memory-in-case-of-error.patch + +# CVE-2019-19046 rhbz 1774988 1774989 +Patch514: ipmi-Fix-memory-leak-in-__ipmi_bmc_register.patch + +# CVE-2019-19050 rhbz 1774998 1775002 +# CVE-2019-19062 rhbz 1775021 1775023 +Patch515: crypto-user-fix-memory-leak-in-crypto_reportstat.patch + +# CVE-2019-19064 rhbz 1775010 1775011 +Patch516: spi-lpspi-fix-memory-leak-in-fsl_lpspi_probe.patch + +# CVE-2019-19063 rhbz 1775015 1775016 +Patch517: rtlwifi-prevent-memory-leak-in-rtl_usb_probe.patch + +# CVE-2019-19057 rhbz 1775050 1775051 +Patch520: mwifiex-pcie-Fix-memory-leak-in-mwifiex_pcie_init_evt_ring.patch + +# CVE-2019-19053 rhbz 1775956 1775110 +Patch521: rpmsg-char-release-allocated-memory.patch + +# CVE-2019-19056 rhbz 1775097 1775115 +Patch522: mwifiex-pcie-fix-memory-leak-in-mwifiex_pcie_alloc_cmdrsp_buf.patch + +# CVE-2019-19054 rhbz 1775063 1775117 +Patch524: media-rc-prevent-memory-leak-in-cx23888_ir_probe.patch + # END OF PATCH DEFINITIONS %endif @@ -2508,6 +2548,22 @@ fi # # %changelog +* Thu Nov 21 2019 Justin M. Forbes - 5.3.12-300 +- Fix CVE-2019-19071 (rhbz 1774949 1774950) +- Fix CVE-2019-19070 (rhbz 1774957 1774958) +- Fix CVE-2019-19068 (rhbz 1774963 1774965) +- Fix CVE-2019-19043 (rhbz 1774972 1774973) +- Fix CVE-2019-19066 (rhbz 1774976 1774978) +- Fix CVE-2019-19046 (rhbz 1774988 1774989) +- Fix CVE-2019-19050 (rhbz 1774998 1775002) +- Fix CVE-2019-19062 (rhbz 1775021 1775023) +- Fix CVE-2019-19064 (rhbz 1775010 1775011) +- Fix CVE-2019-19063 (rhbz 1775015 1775016) +- Fix CVE-2019-19057 (rhbz 1775050 1775051) +- Fix CVE-2019-19053 (rhbz 1775956 1775110) +- Fix CVE-2019-19056 (rhbz 1775097 1775115) +- Fix CVE-2019-19054 (rhbz 1775063 1775117) + * Wed Nov 20 2019 Laura Abbott - 5.4.0-0.rc8.git0.2 - bump and build to check the pesign diff --git a/media-rc-prevent-memory-leak-in-cx23888_ir_probe.patch b/media-rc-prevent-memory-leak-in-cx23888_ir_probe.patch new file mode 100644 index 000000000..10ec07f22 --- /dev/null +++ b/media-rc-prevent-memory-leak-in-cx23888_ir_probe.patch @@ -0,0 +1,103 @@ +From patchwork Wed Sep 25 15:02:41 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Navid Emamdoost +X-Patchwork-Id: 1131334 +Return-Path: +Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) + by smtp.lore.kernel.org (Postfix) with ESMTP id D12E6C432C2 + for ; Wed, 25 Sep 2019 15:02:56 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id A3ACD21D7B + for ; Wed, 25 Sep 2019 15:02:56 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=fail reason="signature verification failed" (2048-bit key) + header.d=gmail.com header.i=@gmail.com header.b="arASj5Yv" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S2438783AbfIYPC4 (ORCPT + ); + Wed, 25 Sep 2019 11:02:56 -0400 +Received: from mail-io1-f66.google.com ([209.85.166.66]:44698 "EHLO + mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1731142AbfIYPCz (ORCPT + ); + Wed, 25 Sep 2019 11:02:55 -0400 +Received: by mail-io1-f66.google.com with SMTP id j4so14606376iog.11; + Wed, 25 Sep 2019 08:02:53 -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=MWyh3PNmOklfeVqzYOrNwzDcAH8lax2jMCGmRDG4urM=; + b=arASj5Yv5bqz17U8QZVYbble7TDB5sj0TMbNk56fxz5ejOoHyT3kYbYJ/QtfbbLSs6 + iEjbcUYxhDqPRDkxpycr9uysp4vVx+usX4dONocnmhwJEwUZNwBO9gxatNe8zkYv3cBV + 6/zgf3/mu1ElXkjkjabewFHnWgFLNY2bEKtd9Wx3P6FGJyuwNg5dgB8SDQb/2DSr4X9q + aUgMqjBas1yw+cOjn/+KzpYS5k6gjQTDGNc4k+SZec43+S+O208YvxdUJ1ivWceNMa90 + RFPA3kk2XYQIgbJVbmqVTOzfX1l/qDVCb/GHdWaEq3GUolGoF7RGnD3ntqNF7uyElR4g + 1cfA== +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=MWyh3PNmOklfeVqzYOrNwzDcAH8lax2jMCGmRDG4urM=; + b=a11vAjMQ8OwRtbrsNLlkXz9P6ewInEp9Y3Yp+tDjNcUdkcFEfckW79Eoc5EIFPd58E + KdJncVKoKTHG4PNxbHcjBXFY82d8wYP+gzkfv4Fx5zKfi9ZRj03gupr1tq8kAizI6+QM + fQUaDU5Z+kETTNPQx4V9W9WsMituZTsmC3yIjhtyaY9qnvDFpjeIcFi8ityCJ59nqaBs + xDkYx9NCUK/ZkRujeIznZ3kaCDvgTxG/PM02POWE8/CEnkaS4oVwMqIJ1WJqRO4cW5Rd + ak9LLUKankinb6T5dd1BPeVmOq4MJJnB8OrnMrENhtYgLgCDELF9090hqfpBkv4FW4zN + vGOQ== +X-Gm-Message-State: APjAAAULnVDgP2mQfcWBZXj8JYWYlmhlw/fk0WqZRMbvjRR4s+BO+yLW + YtHDvZSJqP12YLMYI6zTrm0= +X-Google-Smtp-Source: + APXvYqwPBH16FuEXUH7rOy3JWTXRjXFzwF9Spfa1QHh9p2MfWd+kBFJthLybBlVk8lVb6Ym4UWB2NA== +X-Received: by 2002:a5d:8ad4:: with SMTP id e20mr2109019iot.203.1569423773435; + Wed, 25 Sep 2019 08:02:53 -0700 (PDT) +Received: from cs-dulles.cs.umn.edu (cs-dulles.cs.umn.edu. [128.101.35.54]) + by smtp.googlemail.com with ESMTPSA id + 2sm206447ilw.50.2019.09.25.08.02.52 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Wed, 25 Sep 2019 08:02:52 -0700 (PDT) +From: Navid Emamdoost +Cc: emamd001@umn.edu, smccaman@umn.edu, kjlu@umn.edu, + Navid Emamdoost , + Mauro Carvalho Chehab , + Kate Stewart , + Thomas Gleixner , + Allison Randal , + Greg Kroah-Hartman , + Sean Young , linux-media@vger.kernel.org, + linux-kernel@vger.kernel.org +Subject: [PATCH] media: rc: prevent memory leak in cx23888_ir_probe +Date: Wed, 25 Sep 2019 10:02:41 -0500 +Message-Id: <20190925150244.13644-1-navid.emamdoost@gmail.com> +X-Mailer: git-send-email 2.17.1 +To: unlisted-recipients:; (no To-header on input) +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-kernel@vger.kernel.org + +In cx23888_ir_probe if kfifo_alloc fails the allocated memory for state +should be released. + +Signed-off-by: Navid Emamdoost +--- + drivers/media/pci/cx23885/cx23888-ir.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/media/pci/cx23885/cx23888-ir.c b/drivers/media/pci/cx23885/cx23888-ir.c +index e880afe37f15..90e7c32c54bb 100644 +--- a/drivers/media/pci/cx23885/cx23888-ir.c ++++ b/drivers/media/pci/cx23885/cx23888-ir.c +@@ -1167,8 +1167,11 @@ int cx23888_ir_probe(struct cx23885_dev *dev) + return -ENOMEM; + + spin_lock_init(&state->rx_kfifo_lock); +- if (kfifo_alloc(&state->rx_kfifo, CX23888_IR_RX_KFIFO_SIZE, GFP_KERNEL)) ++ if (kfifo_alloc(&state->rx_kfifo, CX23888_IR_RX_KFIFO_SIZE, ++ GFP_KERNEL)) { ++ kfree(state); + return -ENOMEM; ++ } + + state->dev = dev; + sd = &state->sd; diff --git a/mwifiex-pcie-Fix-memory-leak-in-mwifiex_pcie_init_evt_ring.patch b/mwifiex-pcie-Fix-memory-leak-in-mwifiex_pcie_init_evt_ring.patch new file mode 100644 index 000000000..b606e1c82 --- /dev/null +++ b/mwifiex-pcie-Fix-memory-leak-in-mwifiex_pcie_init_evt_ring.patch @@ -0,0 +1,111 @@ +From patchwork Fri Oct 4 20:16:48 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Navid Emamdoost +X-Patchwork-Id: 11175265 +X-Patchwork-Delegate: kvalo@adurom.com +Return-Path: +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8B95B16B1 + for ; + Fri, 4 Oct 2019 20:17:03 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id 695CE222BE + for ; + Fri, 4 Oct 2019 20:17:03 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=fail reason="signature verification failed" (2048-bit key) + header.d=gmail.com header.i=@gmail.com header.b="eKzyOkdw" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1731313AbfJDUQ7 (ORCPT + ); + Fri, 4 Oct 2019 16:16:59 -0400 +Received: from mail-io1-f66.google.com ([209.85.166.66]:38177 "EHLO + mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1727978AbfJDUQ7 (ORCPT + ); + Fri, 4 Oct 2019 16:16:59 -0400 +Received: by mail-io1-f66.google.com with SMTP id u8so16270784iom.5; + Fri, 04 Oct 2019 13:16:59 -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=hT/oExY7ats1AqepuNnxgrg+W5xUde0ZFah/AwhjxeA=; + b=eKzyOkdwTVgDQ2K7yVdvbQpQ2Y5o9gQHjf1ZLs/0TtknuoSEf88gRE3B/VgSXRe2nM + MaPWiP+DFmtmMOa4V+/fIXuzmU7h0LfbH92QwqYCh6xpzlPF6Y4etarqtYGFwcN8YIFh + KTbhy9t0/3m87L4UKRDIPV+aiyoEDLA1YrY+pxytqsh/8wTp82JG4WTVt4pgwk2YsDFT + TYQK7y3xY2D8O2nwUROYE+zlwF6oua9EA/ixXRVx4CRlh/lRFc124Qw5TlMD2GZdMIPJ + 3GHq32K5Z1F8XMQnUSU6+WxybmUN18B736DtQMDHjjnt70M8oCb/qgoMbH3Bx6xDBx4t + mwIQ== +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=hT/oExY7ats1AqepuNnxgrg+W5xUde0ZFah/AwhjxeA=; + b=OCKRhcqw7kz4tZ/5U2VB84zj0RK/HtQHQ0/BUR0GLJMYOM7HJ1WBdSXnPtJs7UfIX1 + +C4Eq7PaUUpYg+OTWL+BOB7HpPh2AWvmoN/pElS49IYwKCcF9gUb/yfz1ZPSZBZrILg5 + pLgkiiBqoKOaUgVMzBGUs53mAhE7h0RuUDK3i3lptARoQDhVnRCk3HW6uz9G1pjCG6+m + nOC9rnGsphMQZ30AbdG6u8z1oVH+F63nWumldsiz4sNMs++qwDXS5a9ho2EjS9cZwCnL + c3V0vn5HgDqWWVwakE75xEnYAmApdEOC+BtAw6/zMFPMGWoDI98gN1u2ej7Ig6VZ3sDY + GmXA== +X-Gm-Message-State: APjAAAUvXc/AEaa09LdQbBGOHXwA82YLzxvRaRqZB1BY9YQoSNU4yJRa + 7zybbZ/DYfKfmszLK0NP4Vs= +X-Google-Smtp-Source: + APXvYqzNrXPxTps0mq67LtrgFhdE+kz3sXZyk7jqXZoSLFBjfwzONVFvHnNSmdK/pmDZR02HMuSgCw== +X-Received: by 2002:a6b:6e02:: with SMTP id d2mr5637516ioh.8.1570220218662; + Fri, 04 Oct 2019 13:16:58 -0700 (PDT) +Received: from cs-dulles.cs.umn.edu (cs-dulles.cs.umn.edu. [128.101.35.54]) + by smtp.googlemail.com with ESMTPSA id + o5sm2830180ilc.68.2019.10.04.13.16.57 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Fri, 04 Oct 2019 13:16:58 -0700 (PDT) +From: Navid Emamdoost +Cc: emamd001@umn.edu, kjlu@umn.edu, smccaman@umn.edu, + Navid Emamdoost , + Amitkumar Karwar , + Nishant Sarmukadam , + Ganapathi Bhat , + Xinming Hu , + Kalle Valo , + "David S. Miller" , + linux-wireless@vger.kernel.org, netdev@vger.kernel.org, + linux-kernel@vger.kernel.org +Subject: [PATCH] mwifiex: pcie: Fix memory leak in mwifiex_pcie_init_evt_ring +Date: Fri, 4 Oct 2019 15:16:48 -0500 +Message-Id: <20191004201649.25087-1-navid.emamdoost@gmail.com> +X-Mailer: git-send-email 2.17.1 +To: unlisted-recipients:; (no To-header on input) +Sender: linux-wireless-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-wireless@vger.kernel.org + +In mwifiex_pcie_init_evt_ring, a new skb is allocated which should be +released if mwifiex_map_pci_memory() fails. The release for skb and +card->evtbd_ring_vbase is added. + +Fixes: 0732484b47b5 ("mwifiex: separate ring initialization and ring creation routines") +Signed-off-by: Navid Emamdoost +Acked-by: Ganapathi Bhat +--- + drivers/net/wireless/marvell/mwifiex/pcie.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c +index eff06d59e9df..096334e941a1 100644 +--- a/drivers/net/wireless/marvell/mwifiex/pcie.c ++++ b/drivers/net/wireless/marvell/mwifiex/pcie.c +@@ -687,8 +687,11 @@ static int mwifiex_pcie_init_evt_ring(struct mwifiex_adapter *adapter) + skb_put(skb, MAX_EVENT_SIZE); + + if (mwifiex_map_pci_memory(adapter, skb, MAX_EVENT_SIZE, +- PCI_DMA_FROMDEVICE)) ++ PCI_DMA_FROMDEVICE)) { ++ kfree_skb(skb); ++ kfree(card->evtbd_ring_vbase); + return -1; ++ } + + buf_pa = MWIFIEX_SKB_DMA_ADDR(skb); + diff --git a/mwifiex-pcie-fix-memory-leak-in-mwifiex_pcie_alloc_cmdrsp_buf.patch b/mwifiex-pcie-fix-memory-leak-in-mwifiex_pcie_alloc_cmdrsp_buf.patch new file mode 100644 index 000000000..5c12cb493 --- /dev/null +++ b/mwifiex-pcie-fix-memory-leak-in-mwifiex_pcie_alloc_cmdrsp_buf.patch @@ -0,0 +1,109 @@ +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.5 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, + DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, + HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, + SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable + 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 973EDC47404 + for ; Fri, 4 Oct 2019 20:09:06 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id 700B62133F + for ; Fri, 4 Oct 2019 20:09:06 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kWRjsMO7" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1731310AbfJDUJE (ORCPT ); + Fri, 4 Oct 2019 16:09:04 -0400 +Received: from mail-io1-f68.google.com ([209.85.166.68]:42107 "EHLO + mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1729079AbfJDUJD (ORCPT + ); Fri, 4 Oct 2019 16:09:03 -0400 +Received: by mail-io1-f68.google.com with SMTP id n197so16151518iod.9; + Fri, 04 Oct 2019 13:09:03 -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=TzGHd63YhhSYgCiRZ9tl0C+QqBhc3B9t1YurdXMHHEk=; + b=kWRjsMO7kWGMm/IT1zcaML7wX7Qq9Yq8WRm+RABc1yvFRuSkg1MJFKvuhIADpR86Sk + vk1W0Z5v0fSKpGUd8/OWzfGGYUmUKyVV0GCdL13GMMOSK9DpPSyvyt77eG5WmY3ZmctQ + TGC8Cmmzyp9qWwicYV847MUo/KmeyE8yz2h7Smb7WOcrkh2TV9S23hinrXd+nv5M0ZyF + ASEYU02I8rRxFXPCLp8D/KgP4shuTzi8Fg2/Hk1WrnV7b+j7LB2iDWk/cyp1qilFIKMU + ZBR7mheI1uaHirJEtlL1lGs5B+v25rI82daNM0pAfgJ1uilLnWPeFNCSgjxJjo/1l4rp + Y9qg== +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=TzGHd63YhhSYgCiRZ9tl0C+QqBhc3B9t1YurdXMHHEk=; + b=i14dfaCVcowVdtunic+1Wp2wGV+1ZNLuoXJwp7E15v+1eEJZwFN3kPpygTaLhCxUcK + GwKISgBQGzHrbHDnyg1HwrLXM02Ldx63K+ocW92bWoiabvGepNaNkKLLjh1Cc9Z5Udr5 + FaRfo4jqaLUlKwSETn1kU+GSCbHc7OjVJMEAosWc4bRRpy2Z+vcoUwHuCG5OaNg6EQsh + rYclOJRJfMAu448q1becWoBHIpImXDm50NiWfQtEoUOj5o22/QPRUwaUeIC5LrB/sOiI + ZDVFoRHgEjTok93ZXTlcDfOXok4PcETTA6aDez2v7cwSd2y9Z9PI3Ng1mnPK/vmvqmXW + iQZw== +X-Gm-Message-State: APjAAAXV8P3/lHsEKg8iHeiLr3dvIg5sDmZQ5/1qeeMO2VMTctGtUgtN + UfU23ad10Ce+u/Moful94ba6TP6V/uo= +X-Google-Smtp-Source: APXvYqzID3S043QvcjXSlnz2Lfed2XSsv1r0x047tSPe8/gvBVD1NyJxtMQ/ZV89X4qzhOAjTbC2WA== +X-Received: by 2002:a92:603:: with SMTP id x3mr17481056ilg.295.1570219742776; + Fri, 04 Oct 2019 13:09:02 -0700 (PDT) +Received: from cs-dulles.cs.umn.edu (cs-dulles.cs.umn.edu. [128.101.35.54]) + by smtp.googlemail.com with ESMTPSA id i67sm4267112ilf.84.2019.10.04.13.09.02 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Fri, 04 Oct 2019 13:09:02 -0700 (PDT) +From: Navid Emamdoost +Cc: emamd001@umn.edu, kjlu@umn.edu, smccaman@umn.edu, + Navid Emamdoost , + Amitkumar Karwar , + Nishant Sarmukadam , + Ganapathi Bhat , + Xinming Hu , + Kalle Valo , + "David S. Miller" , + linux-wireless@vger.kernel.org, netdev@vger.kernel.org, + linux-kernel@vger.kernel.org +Subject: [PATCH] mwifiex: pcie: Fix memory leak in mwifiex_pcie_alloc_cmdrsp_buf +Date: Fri, 4 Oct 2019 15:08:52 -0500 +Message-Id: <20191004200853.23353-1-navid.emamdoost@gmail.com> +X-Mailer: git-send-email 2.17.1 +To: unlisted-recipients:; (no To-header on input) +Sender: netdev-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: netdev@vger.kernel.org +Archived-At: +List-Archive: +List-Post: + +In mwifiex_pcie_alloc_cmdrsp_buf, a new skb is allocated which should be +released if mwifiex_map_pci_memory() fails. The release is added. + +Fixes: fc3314609047 ("mwifiex: use pci_alloc/free_consistent APIs for PCIe") +Signed-off-by: Navid Emamdoost +--- + drivers/net/wireless/marvell/mwifiex/pcie.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c +index eff06d59e9df..1578eaa071bd 100644 +--- a/drivers/net/wireless/marvell/mwifiex/pcie.c ++++ b/drivers/net/wireless/marvell/mwifiex/pcie.c +@@ -1029,8 +1029,10 @@ static int mwifiex_pcie_alloc_cmdrsp_buf(struct mwifiex_adapter *adapter) + } + skb_put(skb, MWIFIEX_UPLD_SIZE); + if (mwifiex_map_pci_memory(adapter, skb, MWIFIEX_UPLD_SIZE, +- PCI_DMA_FROMDEVICE)) ++ PCI_DMA_FROMDEVICE)) { ++ kfree_skb(skb); + return -1; ++ } + + card->cmdrsp_buf = skb; + +-- +2.17.1 + + diff --git a/net-next-v2-9-9-i40e-prevent-memory-leak-in-i40e_setup_macvlans.patch b/net-next-v2-9-9-i40e-prevent-memory-leak-in-i40e_setup_macvlans.patch new file mode 100644 index 000000000..e58103c7a --- /dev/null +++ b/net-next-v2-9-9-i40e-prevent-memory-leak-in-i40e_setup_macvlans.patch @@ -0,0 +1,80 @@ +From patchwork Fri Oct 25 20:42:42 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Jeff Kirsher +X-Patchwork-Id: 1184451 +X-Patchwork-Delegate: davem@davemloft.net +Return-Path: +X-Original-To: patchwork-incoming-netdev@ozlabs.org +Delivered-To: patchwork-incoming-netdev@ozlabs.org +Authentication-Results: ozlabs.org; spf=none (no SPF record) + smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; + helo=vger.kernel.org; + envelope-from=netdev-owner@vger.kernel.org; + receiver=) +Authentication-Results: ozlabs.org; + dmarc=fail (p=none dis=none) header.from=intel.com +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by ozlabs.org (Postfix) with ESMTP id 470GJz096Tz9sPf + for ; + Sat, 26 Oct 2019 07:42:59 +1100 (AEDT) +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1728655AbfJYUmz (ORCPT + ); + Fri, 25 Oct 2019 16:42:55 -0400 +Received: from mga11.intel.com ([192.55.52.93]:22523 "EHLO mga11.intel.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1728604AbfJYUmq (ORCPT ); + Fri, 25 Oct 2019 16:42:46 -0400 +X-Amp-Result: SKIPPED(no attachment in message) +X-Amp-File-Uploaded: False +Received: from orsmga006.jf.intel.com ([10.7.209.51]) + by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; + 25 Oct 2019 13:42:46 -0700 +X-ExtLoop1: 1 +X-IronPort-AV: E=Sophos;i="5.68,229,1569308400"; d="scan'208";a="202713981" +Received: from jtkirshe-desk1.jf.intel.com ([134.134.177.96]) + by orsmga006.jf.intel.com with ESMTP; 25 Oct 2019 13:42:44 -0700 +From: Jeff Kirsher +To: davem@davemloft.net +Cc: Navid Emamdoost , + netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com, + Andrew Bowers , + Jeff Kirsher +Subject: [net-next v2 9/9] i40e: prevent memory leak in i40e_setup_macvlans +Date: Fri, 25 Oct 2019 13:42:42 -0700 +Message-Id: <20191025204242.10535-10-jeffrey.t.kirsher@intel.com> +X-Mailer: git-send-email 2.21.0 +In-Reply-To: <20191025204242.10535-1-jeffrey.t.kirsher@intel.com> +References: <20191025204242.10535-1-jeffrey.t.kirsher@intel.com> +MIME-Version: 1.0 +Sender: netdev-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: netdev@vger.kernel.org + +From: Navid Emamdoost + +In i40e_setup_macvlans if i40e_setup_channel fails the allocated memory +for ch should be released. + +Signed-off-by: Navid Emamdoost +Tested-by: Andrew Bowers +Signed-off-by: Jeff Kirsher +--- + drivers/net/ethernet/intel/i40e/i40e_main.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c +index 2e4df0bd8d37..141575ada588 100644 +--- a/drivers/net/ethernet/intel/i40e/i40e_main.c ++++ b/drivers/net/ethernet/intel/i40e/i40e_main.c +@@ -7187,6 +7187,7 @@ static int i40e_setup_macvlans(struct i40e_vsi *vsi, u16 macvlan_cnt, u16 qcnt, + ch->num_queue_pairs = qcnt; + if (!i40e_setup_channel(pf, vsi, ch)) { + ret = -EINVAL; ++ kfree(ch); + goto err_free; + } + ch->parent_vsi = vsi; diff --git a/rpmsg-char-release-allocated-memory.patch b/rpmsg-char-release-allocated-memory.patch new file mode 100644 index 000000000..fa44f8468 --- /dev/null +++ b/rpmsg-char-release-allocated-memory.patch @@ -0,0 +1,103 @@ +From patchwork Tue Sep 17 03:31:23 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Navid Emamdoost +X-Patchwork-Id: 11148039 +Return-Path: +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AADA514E5 + for ; + Tue, 17 Sep 2019 03:31:44 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id 8922720650 + for ; + Tue, 17 Sep 2019 03:31:44 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=fail reason="signature verification failed" (2048-bit key) + header.d=gmail.com header.i=@gmail.com header.b="rGHRRJc6" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S2392211AbfIQDbo (ORCPT + ); + Mon, 16 Sep 2019 23:31:44 -0400 +Received: from mail-io1-f65.google.com ([209.85.166.65]:43574 "EHLO + mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1730000AbfIQDbo (ORCPT + ); + Mon, 16 Sep 2019 23:31:44 -0400 +Received: by mail-io1-f65.google.com with SMTP id v2so4080968iob.10; + Mon, 16 Sep 2019 20:31:43 -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=AZbBTIbQbqXwZoo2mD7WVQh8P9va3DGLxdwCMpbqykM=; + b=rGHRRJc6cmlQU6fzDipZt7KO5qJAWDWcnNDKSmndXpk0ewSLW23M8z7MSAS//IRj1l + tALlRIDw+7SUzX5oZBm7estXiqj5CDURnMfZuF79BxBQ+zBn15C215GlFtTeHRuG5oJR + v35CbGdsHyQUlJbZwndh7jhpbviDigFIUwvtN87/RcR1LLkquGA24oKzOknAIZzGKLxO + 7oJx7GgYMDJcZTaQBiy1SXTwC0dRQjDNmtdSjt40yzfROfi7nvGYsEyGo683REJTh3cr + Csz+zl2qSybIJaFl1b9JqdfU0fZdWLhwBvZAW6VFTo1GDKCalj3bu56OLWpXe5/2EyHe + k8+Q== +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=AZbBTIbQbqXwZoo2mD7WVQh8P9va3DGLxdwCMpbqykM=; + b=H0T7GzjEzd76Q4M+fZ0zeWuyI2xvoQ6DwrCEEZr3Gb78xewtcJrJ2Uoy02HqXTY7Wh + wPXhKdlNpvGEAr5jCqHSqAO97xEf0q8Uo+5PTpbIePdn6AUBy+oZq95pT7ugT55Lw+X4 + 0q/Ef6854dvkM3Z9cjers0ia9MTaDYv1Ipn5SZ0gb87EvuZ9iQxfcNxpiqrAR3DfEGIH + LTwDRowj4YD0b9QqzpEyDlqbsMWY2241Yfj+awLnJ0gOSCTnAhE/BlgB2BrraWvCYfFH + t7thN0U6VI7faKxaP/Q1pUMeJ3tIcq+5lXfEzZecdIBxHFvS5W4u4eULnDUKhaa/jk4u + SLbQ== +X-Gm-Message-State: APjAAAVgR6KWN4oOwYJYA/Y6CJAcZxUfM16AUVfuG/Yx618weACP4BC4 + YV7/xT1rb1pLuAt/gojQxXgdV4jgRos= +X-Google-Smtp-Source: + APXvYqx4BGYBTXWug5NY3wJbo99uGA8r8HQaH6QnaLuCl7KSJytf2lAhCbNRWnl2/4bx5Sw7OH9Ksg== +X-Received: by 2002:a6b:c7c2:: with SMTP id + x185mr1469065iof.224.1568691103125; + Mon, 16 Sep 2019 20:31:43 -0700 (PDT) +Received: from cs-dulles.cs.umn.edu (cs-dulles.cs.umn.edu. [128.101.35.54]) + by smtp.googlemail.com with ESMTPSA id + i26sm1134258ion.40.2019.09.16.20.31.42 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Mon, 16 Sep 2019 20:31:42 -0700 (PDT) +From: Navid Emamdoost +Cc: emamd001@umn.edu, smccaman@umn.edu, kjlu@umn.edu, + Navid Emamdoost , + Ohad Ben-Cohen , + Bjorn Andersson , + linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org +Subject: [PATCH] rpmsg: char: release allocated memory +Date: Mon, 16 Sep 2019 22:31:23 -0500 +Message-Id: <20190917033124.1077-1-navid.emamdoost@gmail.com> +X-Mailer: git-send-email 2.17.1 +To: unlisted-recipients:; (no To-header on input) +Sender: linux-remoteproc-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-remoteproc@vger.kernel.org + +In rpmsg_eptdev_write_iter, if copy_from_iter_full fails the allocated +buffer needs to be released. + +Signed-off-by: Navid Emamdoost +--- + drivers/rpmsg/rpmsg_char.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/drivers/rpmsg/rpmsg_char.c b/drivers/rpmsg/rpmsg_char.c +index eea5ebbb5119..c655074c07c2 100644 +--- a/drivers/rpmsg/rpmsg_char.c ++++ b/drivers/rpmsg/rpmsg_char.c +@@ -227,8 +227,10 @@ static ssize_t rpmsg_eptdev_write_iter(struct kiocb *iocb, + if (!kbuf) + return -ENOMEM; + +- if (!copy_from_iter_full(kbuf, len, from)) +- return -EFAULT; ++ if (!copy_from_iter_full(kbuf, len, from)) { ++ ret = -EFAULT; ++ goto free_kbuf; ++ } + + if (mutex_lock_interruptible(&eptdev->ept_lock)) { + ret = -ERESTARTSYS; diff --git a/rsi-release-skb-if-rsi_prepare_beacon-fails.patch b/rsi-release-skb-if-rsi_prepare_beacon-fails.patch new file mode 100644 index 000000000..64c40f408 --- /dev/null +++ b/rsi-release-skb-if-rsi_prepare_beacon-fails.patch @@ -0,0 +1,101 @@ +From patchwork Sat Sep 14 00:08:11 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Navid Emamdoost +X-Patchwork-Id: 11145515 +X-Patchwork-Delegate: kvalo@adurom.com +Return-Path: +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3BDCB14DB + for ; + Sat, 14 Sep 2019 00:08:28 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id 1C8DC20692 + for ; + Sat, 14 Sep 2019 00:08:28 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=fail reason="signature verification failed" (2048-bit key) + header.d=gmail.com header.i=@gmail.com header.b="H4ki8bM3" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S2390814AbfINAIX (ORCPT + ); + Fri, 13 Sep 2019 20:08:23 -0400 +Received: from mail-io1-f67.google.com ([209.85.166.67]:38748 "EHLO + mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S2390793AbfINAIX (ORCPT + ); + Fri, 13 Sep 2019 20:08:23 -0400 +Received: by mail-io1-f67.google.com with SMTP id k5so41134655iol.5; + Fri, 13 Sep 2019 17:08:22 -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=jwG/Aiknb+UcZynbTQk90VqogFgsnd/QMY7azs6Zupc=; + b=H4ki8bM3b9Bmty2ruf5ZSCj1ONr4jsOiep+vLMdBWcjq1+6e8umPfwLlGHYesuoz/Q + VF5OFoRIgllqVfRh1O0ob/rthiQm73toq+PTtrX9iKlZ8u3smXrOHJ2yH7252RrvcFpT + O3TQVuU3UKw0Am3Efn13+5jVOA3Oh/oH5UC9uNsla1kvJ3F/R6nBoiOSwOMnclPvgRSn + vay6xtYVjr5LkBAO60l/e/agltxV8p/eNiUH2xLAV7FcQ7951+WbMmnXr40trn8HDEj4 + 6yl80zQa8B2dbLThm6nFvE462hhCUY3BrldbuGcsFiHG7iW0/cIshuHIso8SieQZdhM+ + gIzw== +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=jwG/Aiknb+UcZynbTQk90VqogFgsnd/QMY7azs6Zupc=; + b=sTBiyouiK4UyXL4mE50HQlhIkI9Ns2+bLnk+9IC/vhspdjwj+xTPQI2DtQxLD94ruR + EUXt194VEVxAqhmZQJy2MmYkPLsTxt31pXvm59EGf0bFyboMEVIx/BOWcqjS1+pOKH4I + PisI3obo+CTL2hsat1wiEc2pMg+ZsZKzwlboyXVB0sL/FjH0xkEqAF1YC39sbegiiU6P + PX/iDiNXMRckuIc/hvl5JA+8DFBj6onQYoXyPjRG7Ry122UQPLyu9SCSc2nGtgiv/EqM + 0YAhTTXDm0FyknKt7MoTbOuMcDqzz/io6uTl6/oMPotLSrKVAe+8u0V/hl9WS8VvitOm + U3xw== +X-Gm-Message-State: APjAAAUnAd+MBw2rCpslu6F+1lT07zH7ui3l7LUI6IDQAbTwKXToMRDT + yPjM/YAgsdE/f2RMGo4WmJhx7rwf6+4= +X-Google-Smtp-Source: + APXvYqw7AMJKs0y62zgNzfsmBOSndsvr5y6XtYV+6wx/T/jGH6LPa1JJmCjPhOygc0/qx3csQoLVXA== +X-Received: by 2002:a6b:5b07:: with SMTP id v7mr3108833ioh.76.1568419702221; + Fri, 13 Sep 2019 17:08:22 -0700 (PDT) +Received: from cs-dulles.cs.umn.edu (cs-dulles.cs.umn.edu. [128.101.35.54]) + by smtp.googlemail.com with ESMTPSA id + t9sm3973230iop.86.2019.09.13.17.08.21 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Fri, 13 Sep 2019 17:08:21 -0700 (PDT) +From: Navid Emamdoost +Cc: emamd001@umn.edu, smccaman@umn.edu, kjlu@umn.edu, + Navid Emamdoost , + Amitkumar Karwar , + Siva Rebbagondla , + Kalle Valo , + "David S. Miller" , + linux-wireless@vger.kernel.org, netdev@vger.kernel.org, + linux-kernel@vger.kernel.org +Subject: [PATCH] rsi: release skb if rsi_prepare_beacon fails +Date: Fri, 13 Sep 2019 19:08:11 -0500 +Message-Id: <20190914000812.10188-1-navid.emamdoost@gmail.com> +X-Mailer: git-send-email 2.17.1 +To: unlisted-recipients:; (no To-header on input) +Sender: linux-wireless-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-wireless@vger.kernel.org + +In rsi_send_beacon, if rsi_prepare_beacon fails the allocated skb should +be released. + +Signed-off-by: Navid Emamdoost +--- + drivers/net/wireless/rsi/rsi_91x_mgmt.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/wireless/rsi/rsi_91x_mgmt.c b/drivers/net/wireless/rsi/rsi_91x_mgmt.c +index 6c7f26ef6476..9cc8a335d519 100644 +--- a/drivers/net/wireless/rsi/rsi_91x_mgmt.c ++++ b/drivers/net/wireless/rsi/rsi_91x_mgmt.c +@@ -1756,6 +1756,7 @@ static int rsi_send_beacon(struct rsi_common *common) + skb_pull(skb, (64 - dword_align_bytes)); + if (rsi_prepare_beacon(common, skb)) { + rsi_dbg(ERR_ZONE, "Failed to prepare beacon\n"); ++ dev_kfree_skb(skb); + return -EINVAL; + } + skb_queue_tail(&common->tx_queue[MGMT_BEACON_Q], skb); diff --git a/rtl8xxxu-prevent-leaking-urb.patch b/rtl8xxxu-prevent-leaking-urb.patch new file mode 100644 index 000000000..ff088dea0 --- /dev/null +++ b/rtl8xxxu-prevent-leaking-urb.patch @@ -0,0 +1,101 @@ +From patchwork Fri Sep 20 03:00:41 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Navid Emamdoost +X-Patchwork-Id: 11153733 +X-Patchwork-Delegate: kvalo@adurom.com +Return-Path: +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7607B76 + for ; + Fri, 20 Sep 2019 03:00:56 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id 48CF521929 + for ; + Fri, 20 Sep 2019 03:00:56 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=fail reason="signature verification failed" (2048-bit key) + header.d=gmail.com header.i=@gmail.com header.b="fzAGUdQV" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S2405830AbfITDAw (ORCPT + ); + Thu, 19 Sep 2019 23:00:52 -0400 +Received: from mail-io1-f66.google.com ([209.85.166.66]:44050 "EHLO + mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S2389956AbfITDAv (ORCPT + ); + Thu, 19 Sep 2019 23:00:51 -0400 +Received: by mail-io1-f66.google.com with SMTP id j4so12740088iog.11; + Thu, 19 Sep 2019 20:00:51 -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=wR9pye3sH3f9c/Ue486PD/cpETKoqUyEfHnMaMiRPdY=; + b=fzAGUdQVIXP8BO6Um0bEY7aXmxWrofp3WYusEuhMgPmQ27A5ZhIq51xSMAN9gohJey + xdsD6nXME5ZveH9/lQ1MvNo7e8lxKB+VJiF53+KRWHjYY3yo3CO+r/lMh38wUGe5T120 + NI5FyQ8YmYV/aaqGUTa6/SbDVBDZBSb3F3uOkXNjWxRyI80HGsx60/fhQaY8HNtHHcDb + 511aV1DthYS9mGIh4z56qpebAKs9Q6CMcrqtYaemGR01y1sZsyooYZweWPqYYQ28lZUi + oVHgUKZHp3jvfYhzZnVc8ousIPPiZiLXszN06Siqs6CGkR6p4m+lf80we8Xi6J0bEISz + hFBw== +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=wR9pye3sH3f9c/Ue486PD/cpETKoqUyEfHnMaMiRPdY=; + b=mUe4i46sJphvT9eHFwqTegYlyqNnE95+R/GbAr/Is0OJfzCFXHu/cUrw5ElaQR4ATd + ShSEU7xpcL4ISPtNRc3kSBvt3ROv3RHbxdgCw3UYVG+DJLMet3AvPnJT0bwN5UWcCodd + z7bw4VprjwTZj8WPj+itlX2LdPws17O4C/ROM8RuRJ7MFQLwCg0qLscbxBXwKUsnyoTp + KIi52u4X85ABBEBFgGrx6ZS/sllG/u+spcSMjf/TVV0UglkLy7sRgZ4gyMBHgbMrzUDO + tGJQMGon7uU9OTA6a73s3ap8eeQ/c8KZUftJBh6c7xJL7qrH5lfZJSQBjePgKF+RF/rt + 40wQ== +X-Gm-Message-State: APjAAAWUFzu7MpjxWJtu4hgZuo8rk1uE8i27EiFcdjhNEG5ZaOg9jkNB + zqGym44mT1nF7nFS4RHjg/Y= +X-Google-Smtp-Source: + APXvYqwI+IXRu7Lhr0HmMj08qfXGIRkcCHYMdmSMkCW5GIIz+Ml1cQ5Uy6GCUGV2WrCpixMQAv4aog== +X-Received: by 2002:a02:ac82:: with SMTP id x2mr13978167jan.34.1568948450810; + Thu, 19 Sep 2019 20:00:50 -0700 (PDT) +Received: from cs-dulles.cs.umn.edu (cs-dulles.cs.umn.edu. [128.101.35.54]) + by smtp.googlemail.com with ESMTPSA id + t9sm380269iop.86.2019.09.19.20.00.50 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Thu, 19 Sep 2019 20:00:50 -0700 (PDT) +From: Navid Emamdoost +Cc: emamd001@umn.edu, smccaman@umn.edu, kjlu@umn.edu, + Navid Emamdoost , + Jes Sorensen , + Kalle Valo , + "David S. Miller" , + linux-wireless@vger.kernel.org, netdev@vger.kernel.org, + linux-kernel@vger.kernel.org +Subject: [PATCH] rtl8xxxu: prevent leaking urb +Date: Thu, 19 Sep 2019 22:00:41 -0500 +Message-Id: <20190920030043.30137-1-navid.emamdoost@gmail.com> +X-Mailer: git-send-email 2.17.1 +To: unlisted-recipients:; (no To-header on input) +Sender: linux-wireless-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-wireless@vger.kernel.org + +In rtl8xxxu_submit_int_urb if usb_submit_urb fails the allocated urb +should be released. + +Signed-off-by: Navid Emamdoost +Reviewed-by: Chris Chiu +--- + drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +index 8136e268b4e6..4a559c37e208 100644 +--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c ++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +@@ -5443,6 +5443,7 @@ static int rtl8xxxu_submit_int_urb(struct ieee80211_hw *hw) + ret = usb_submit_urb(urb, GFP_KERNEL); + if (ret) { + usb_unanchor_urb(urb); ++ usb_free_urb(urb); + goto error; + } + diff --git a/rtlwifi-prevent-memory-leak-in-rtl_usb_probe.patch b/rtlwifi-prevent-memory-leak-in-rtl_usb_probe.patch new file mode 100644 index 000000000..69d1c0f46 --- /dev/null +++ b/rtlwifi-prevent-memory-leak-in-rtl_usb_probe.patch @@ -0,0 +1,110 @@ +From patchwork Wed Sep 25 01:20:21 2019 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Navid Emamdoost +X-Patchwork-Id: 1131161 +Return-Path: +Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) + by smtp.lore.kernel.org (Postfix) with ESMTP id BC591C432C1 + for ; Wed, 25 Sep 2019 01:20:44 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id 8BCDC2146E + for ; Wed, 25 Sep 2019 01:20:44 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=fail reason="signature verification failed" (2048-bit key) + header.d=gmail.com header.i=@gmail.com header.b="SWiOz5xt" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S2411353AbfIYBUn (ORCPT + ); + Tue, 24 Sep 2019 21:20:43 -0400 +Received: from mail-io1-f68.google.com ([209.85.166.68]:33885 "EHLO + mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S2392379AbfIYBUn (ORCPT + ); + Tue, 24 Sep 2019 21:20:43 -0400 +Received: by mail-io1-f68.google.com with SMTP id q1so9351551ion.1; + Tue, 24 Sep 2019 18:20:42 -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=mQUUiLblrejWrKd0KlOdzOcENXF40rH5GYEM9TuaSS4=; + b=SWiOz5xtaFHfAe7qhrZOfB3XaTTABaRoUA2WkntQTu6mZLAPtLqltcn1HSz4FOVdmc + C4hiQS6HxKitVmGPHJR6BnOiAdmb8p/ke41JsAiVtxDyJj/EtgPgcn000LqwSw2XXpRs + aJsehFF9sM31eMjJ3jPJMVhf1moysCBTI8rG+6ARu4tg//7sLz/cZpWsKuTFtLA41S2X + Moj049CPHidyuiCC+TLFAA4dTAVT1wk5YorB1e+xMSVKHkW4g3k4FuVp38c12CmbT13R + wsO2tqJ0iRFy2a/3SfO203+i0XYenfEQ/WWVu5ywTPrwX422oKO4PeywgDE5pL7ILA7N + 5lXA== +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=mQUUiLblrejWrKd0KlOdzOcENXF40rH5GYEM9TuaSS4=; + b=PVpA/fyBIdoLH3ctyZntsZiwJLKRkFCP/mefxIVWehzdNs+J01dhg9UvthHik8uSD0 + WAfXOKljH2T6Dz6LC8B/araiwV5iwm9zy3h1VlfLlervg6lYtMtGN8XfNFJccvIcoFIf + 0rOQal8NWpkvib3lEqdVdolhDogapBQWxjPQApj9tuYkO3JWOpr994A5Legt0Ha/Mdpg + iLum0KUzciv2wLRhPIGTis08rgOJQbuV/lWNmEkCqbS6tSlvN/HH7apJEJU+Xm1vfhqB + SB2zOsviArNFeNhb/VpZyY329Au5/aGwh06J3nI6xfxyUSWEDCs24g1LN/PL7ESZvquK + +kzg== +X-Gm-Message-State: APjAAAWn+51fVnTld2M5xyo/OXfdxePecAEGRlXft7qNHI0Gnp9EyVgR + otCkul6uMkwDI6M6UjbBXIo20ZwJqcc= +X-Google-Smtp-Source: + APXvYqwYH0op/7MmCPiM8xAfMsxn7k8FX5LrV/HLNynk01ydo/cjks9o5mJOS8EhqcleAu7Y+qfNeQ== +X-Received: by 2002:a02:5ec4:: with SMTP id + h187mr2345350jab.101.1569374442036; + Tue, 24 Sep 2019 18:20:42 -0700 (PDT) +Received: from cs-dulles.cs.umn.edu (cs-dulles.cs.umn.edu. [128.101.35.54]) + by smtp.googlemail.com with ESMTPSA id + r12sm28225ilq.70.2019.09.24.18.20.41 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Tue, 24 Sep 2019 18:20:41 -0700 (PDT) +From: Navid Emamdoost +Cc: emamd001@umn.edu, smccaman@umn.edu, kjlu@umn.edu, + Navid Emamdoost , + Ping-Ke Shih , + Kalle Valo , + "David S. Miller" , + linux-wireless@vger.kernel.org, netdev@vger.kernel.org, + linux-kernel@vger.kernel.org +Subject: [PATCH] rtlwifi: prevent memory leak in rtl_usb_probe +Date: Tue, 24 Sep 2019 20:20:21 -0500 +Message-Id: <20190925012022.13727-1-navid.emamdoost@gmail.com> +X-Mailer: git-send-email 2.17.1 +To: unlisted-recipients:; (no To-header on input) +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-kernel@vger.kernel.org + +In rtl_usb_probe if allocation for usb_data fails the allocated hw +should be released. In addition the allocated rtlpriv->usb_data should +be released on error handling path. + +Signed-off-by: Navid Emamdoost +--- + drivers/net/wireless/realtek/rtlwifi/usb.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/realtek/rtlwifi/usb.c b/drivers/net/wireless/realtek/rtlwifi/usb.c +index 4b59f3b46b28..348b0072cdd6 100644 +--- a/drivers/net/wireless/realtek/rtlwifi/usb.c ++++ b/drivers/net/wireless/realtek/rtlwifi/usb.c +@@ -1021,8 +1021,10 @@ int rtl_usb_probe(struct usb_interface *intf, + rtlpriv->hw = hw; + rtlpriv->usb_data = kcalloc(RTL_USB_MAX_RX_COUNT, sizeof(u32), + GFP_KERNEL); +- if (!rtlpriv->usb_data) ++ if (!rtlpriv->usb_data) { ++ ieee80211_free_hw(hw); + return -ENOMEM; ++ } + + /* this spin lock must be initialized early */ + spin_lock_init(&rtlpriv->locks.usb_lock); +@@ -1083,6 +1085,7 @@ int rtl_usb_probe(struct usb_interface *intf, + _rtl_usb_io_handler_release(hw); + usb_put_dev(udev); + complete(&rtlpriv->firmware_loading_complete); ++ kfree(rtlpriv->usb_data); + return -ENODEV; + } + EXPORT_SYMBOL(rtl_usb_probe); diff --git a/scsi-bfa-release-allocated-memory-in-case-of-error.patch b/scsi-bfa-release-allocated-memory-in-case-of-error.patch new file mode 100644 index 000000000..6bbf61364 --- /dev/null +++ b/scsi-bfa-release-allocated-memory-in-case-of-error.patch @@ -0,0 +1,105 @@ +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=DKIM_ADSP_CUSTOM_MED, + DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, + HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, + SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable + 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 91A3BC49ED7 + for ; Tue, 10 Sep 2019 23:44:32 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id 695AB216F4 + for ; Tue, 10 Sep 2019 23:44:32 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="agIEQzR/" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1726192AbfIJXo2 (ORCPT ); + Tue, 10 Sep 2019 19:44:28 -0400 +Received: from mail-io1-f68.google.com ([209.85.166.68]:47033 "EHLO + mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1725876AbfIJXo2 (ORCPT + ); Tue, 10 Sep 2019 19:44:28 -0400 +Received: by mail-io1-f68.google.com with SMTP id d17so19749943ios.13; + Tue, 10 Sep 2019 16:44:28 -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=ZGP+PYUf116KpmFZWCQJ/+W1BpD8OneYbmbPw8KI1DY=; + b=agIEQzR/UIcZsX92ydKv9iYSTD0wKkF0DCdfCvbuRl+mJRlsmk4xv6oXdAgiahYN66 + Y4Q1c3uqGfdg1IWTY8T5VS2bzEO4YTifAiDII2S1ZWE4qCq8jQdhAiMYFsy8Ny7SDa1i + RXfYurzoCzrqs+1B+eQquaIosJ9qTs67bacbWDhEbp+bhuDtAJoSJ2fs0ADFREjunWBy + UiNXq4j/j6LSfUZc7/Al3xGpHnxht5yshuaAEMNrtlbZPVklWY2XcluBTm1eBpVv4pNu + 6n0+q3EwwYu6YMWPprH1JbHi2Uu9ZaR2Jluku1++jFb128U92+e23LofkhY5gkwB7hwY + Liug== +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=ZGP+PYUf116KpmFZWCQJ/+W1BpD8OneYbmbPw8KI1DY=; + b=Vn2eF6QjqBqKG9rCWyHMzAcWxAyjzqoNnmTtmP1drV/AtPZojXG21vO6Yrnrd0w3PE + D6Ej3hyD9banePwuxeoxD9PJaOZhH6vDSisM4T6cdycmHACIq7Q4y0wNLMJHmBpfx92C + WnE4PkQBXz9XrBkbHT0/qI0csFhmBgKD4B+pbnRSAiIqSIt4WSSTwSpLo/TOL7Ub4fTj + pzgVYex3XzJEdoPo2wADo0RBjCbf+JqPDME58Yub8LpfLVerY/I/+jo838cdS9dbfHcN + cD1eu4BYssjD887++aPPqQnIKLOMNl4pra1065KqKPtIfrEB1T9nwAqxbcC8/weZWeAn + MbFA== +X-Gm-Message-State: APjAAAVbAnon8+4rQ6lpU3M2lHtSY87bZtAXd06oMDim1otUrO2FXd8d + LBElDhZf0bU+XXNO4CU1XdQ= +X-Google-Smtp-Source: APXvYqzpHFPcs8wqSh6UDjLhtAgV9r92A+H6PKQaASa8MTnRPf9hCZWEZ/wN9o/vH1jWAEJYkcaPtA== +X-Received: by 2002:a6b:b714:: with SMTP id h20mr37211941iof.302.1568159067609; + Tue, 10 Sep 2019 16:44:27 -0700 (PDT) +Received: from cs-dulles.cs.umn.edu (cs-dulles.cs.umn.edu. [128.101.35.54]) + by smtp.googlemail.com with ESMTPSA id z20sm19383990iof.38.2019.09.10.16.44.26 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Tue, 10 Sep 2019 16:44:27 -0700 (PDT) +From: Navid Emamdoost +Cc: emamd001@umn.edu, smccaman@umn.edu, kjlu@umn.edu, + Navid Emamdoost , + Anil Gurumurthy , + Sudarsana Kalluru , + "James E.J. Bottomley" , + "Martin K. Petersen" , + linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org +Subject: [PATCH] scsi: bfa: release allocated memory in case of error +Date: Tue, 10 Sep 2019 18:44:15 -0500 +Message-Id: <20190910234417.22151-1-navid.emamdoost@gmail.com> +X-Mailer: git-send-email 2.17.1 +To: unlisted-recipients:; (no To-header on input) +Sender: linux-scsi-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-scsi@vger.kernel.org +Archived-At: +List-Archive: +List-Post: + +In bfad_im_get_stats if bfa_port_get_stats fails, allocated memory +needs to be released. + +Signed-off-by: Navid Emamdoost +--- + drivers/scsi/bfa/bfad_attr.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/scsi/bfa/bfad_attr.c b/drivers/scsi/bfa/bfad_attr.c +index 29ab81df75c0..fbfce02e5b93 100644 +--- a/drivers/scsi/bfa/bfad_attr.c ++++ b/drivers/scsi/bfa/bfad_attr.c +@@ -275,8 +275,10 @@ bfad_im_get_stats(struct Scsi_Host *shost) + rc = bfa_port_get_stats(BFA_FCPORT(&bfad->bfa), + fcstats, bfad_hcb_comp, &fcomp); + spin_unlock_irqrestore(&bfad->bfad_lock, flags); +- if (rc != BFA_STATUS_OK) ++ if (rc != BFA_STATUS_OK) { ++ kfree(fcstats); + return NULL; ++ } + + wait_for_completion(&fcomp.comp); + +-- +2.17.1 + + diff --git a/spi-gpio-prevent-memory-leak-in-spi_gpio_probe.patch b/spi-gpio-prevent-memory-leak-in-spi_gpio_probe.patch new file mode 100644 index 000000000..e0a79cfe2 --- /dev/null +++ b/spi-gpio-prevent-memory-leak-in-spi_gpio_probe.patch @@ -0,0 +1,39 @@ +From d3b0ffa1d75d5305ebe34735598993afbb8a869d Mon Sep 17 00:00:00 2001 +From: Navid Emamdoost +Date: Mon, 30 Sep 2019 15:52:40 -0500 +Subject: spi: gpio: prevent memory leak in spi_gpio_probe + +In spi_gpio_probe an SPI master is allocated via spi_alloc_master, but +this controller should be released if devm_add_action_or_reset fails, +otherwise memory leaks. In order to avoid leak spi_contriller_put must +be called in case of failure for devm_add_action_or_reset. + +Fixes: 8b797490b4db ("spi: gpio: Make sure spi_master_put() is called in every error path") +Signed-off-by: Navid Emamdoost +Link: https://lore.kernel.org/r/20190930205241.5483-1-navid.emamdoost@gmail.com +Signed-off-by: Mark Brown +--- + drivers/spi/spi-gpio.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +(limited to 'drivers/spi/spi-gpio.c') + +diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c +index 1d3e23ec20a6..f9c5bbb74714 100644 +--- a/drivers/spi/spi-gpio.c ++++ b/drivers/spi/spi-gpio.c +@@ -371,8 +371,10 @@ static int spi_gpio_probe(struct platform_device *pdev) + return -ENOMEM; + + status = devm_add_action_or_reset(&pdev->dev, spi_gpio_put, master); +- if (status) ++ if (status) { ++ spi_master_put(master); + return status; ++ } + + if (of_id) + status = spi_gpio_probe_dt(pdev, master); +-- +cgit 1.2-0.3.lf.el7 + diff --git a/spi-lpspi-fix-memory-leak-in-fsl_lpspi_probe.patch b/spi-lpspi-fix-memory-leak-in-fsl_lpspi_probe.patch new file mode 100644 index 000000000..918877f5e --- /dev/null +++ b/spi-lpspi-fix-memory-leak-in-fsl_lpspi_probe.patch @@ -0,0 +1,105 @@ +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.4 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, + DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, + HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, + SPF_HELO_NONE,SPF_PASS,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 C92DFC4360C + for ; Mon, 30 Sep 2019 03:46:18 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.kernel.org (Postfix) with ESMTP id 9B3EE20863 + for ; Mon, 30 Sep 2019 03:46:18 +0000 (UTC) +Authentication-Results: mail.kernel.org; + dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MxIuKg6c" +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1729507AbfI3DqO (ORCPT + ); + Sun, 29 Sep 2019 23:46:14 -0400 +Received: from mail-io1-f66.google.com ([209.85.166.66]:35210 "EHLO + mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1726360AbfI3DqO (ORCPT + ); + Sun, 29 Sep 2019 23:46:14 -0400 +Received: by mail-io1-f66.google.com with SMTP id q10so34551005iop.2; + Sun, 29 Sep 2019 20:46:13 -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=CSb8gKQFW+56QuRhWd4MVB/962Fvkd5QK+eXub6cDmE=; + b=MxIuKg6cc7vmVBU35srXcQltSjWfzAQElpoZgAlV4IAegsPDx906fw8dUzLriT4baK + fBI64z8uZ5KseshsQzqi5BVxbpb6LulT2mykTJq/pUGdaGaks60BJexhUMeSfNyaRrSw + jfZjzE0QCgGBSOYA5ovK/1GcPySgrArlnITUbkIzeObOLmetAQSgfIuEmD3QDkMSGBgo + vEJ/PmjTcPWD8rCJc/XKg+rTU7wVeK/VTlmL6KxFvwOwenU6A7VjSjSUIUuRLyY4DrMN + cYq+KCSyF9sfI4q5YOSUdQ0T1s5RpFvx8+sTAS78lMKQQqGwvVqM05jR/nbSHSEltzPy + JHUg== +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=CSb8gKQFW+56QuRhWd4MVB/962Fvkd5QK+eXub6cDmE=; + b=bNFNL53TYUcz8nZsGgBlk1ntXRHaszBkoC9NrxFaR2ySpC2T71F+IlYFFeTyhVcLUW + F9WAID6IG3m1OQEoyR0Hdnz5xkY22u1wVHTx4QWpil9NKsfyBmzVhoAlGmKRvgt1nso3 + 2XJXPzoemp9nWy/y8GTqhFO+OofhRcwJdijhsRitU6J8z5xb0wHCwplFwRGZjRZI9uP7 + /+81BUj3Dhsz4jPbMTT9LrFVvqszsTkzTReqyp6sKnxMKhpfhUQwSX9fRF++E5EBEc3C + X8uCSxmhI2UraYuwaASHqGk+nvpVTkUaNNaaz9J8HNMi0dq7N1xua7AT65rICXDfBvkO + Sdnw== +X-Gm-Message-State: APjAAAWroOwvHW6SHGBmhWef7X7KS1ypb0sPG9ZHVxp4GIygokLX/WFb + 1azxubBLqnwY/4ic3z+D784= +X-Google-Smtp-Source: APXvYqzx55nalXFB8YovlLh9qfXLKQ5njGsXu/sw9z0VR74i+3mZlYSj//BvPzrbGIA2nI5KDHHqbw== +X-Received: by 2002:a92:844b:: with SMTP id l72mr17962867ild.275.1569815173041; + Sun, 29 Sep 2019 20:46:13 -0700 (PDT) +Received: from cs-dulles.cs.umn.edu (cs-dulles.cs.umn.edu. [128.101.35.54]) + by smtp.googlemail.com with ESMTPSA id w16sm5283677ilc.62.2019.09.29.20.46.12 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Sun, 29 Sep 2019 20:46:12 -0700 (PDT) +From: Navid Emamdoost +Cc: emamd001@umn.edu, kjlu@umn.edu, smccaman@umn.edu, + Navid Emamdoost , + Mark Brown , linux-spi@vger.kernel.org, + linux-kernel@vger.kernel.org +Subject: [PATCH] spi: lpspi: fix memory leak in fsl_lpspi_probe +Date: Sun, 29 Sep 2019 22:46:01 -0500 +Message-Id: <20190930034602.1467-1-navid.emamdoost@gmail.com> +X-Mailer: git-send-email 2.17.1 +To: unlisted-recipients:; (no To-header on input) +Sender: linux-kernel-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-kernel@vger.kernel.org +Archived-At: +List-Archive: +List-Post: + +In fsl_lpspi_probe an SPI controller is allocated either via +spi_alloc_slave or spi_alloc_master. In all but one error cases this +controller is put by going to error handling code. This commit fixes the +case when pm_runtime_get_sync fails and it should go to the error +handling path. + +Fixes: 944c01a889d9 ("spi: lpspi: enable runtime pm for lpspi") +Signed-off-by: Navid Emamdoost +--- + drivers/spi/spi-fsl-lpspi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c +index d08e9324140e..3528ed5eea9b 100644 +--- a/drivers/spi/spi-fsl-lpspi.c ++++ b/drivers/spi/spi-fsl-lpspi.c +@@ -938,7 +938,7 @@ static int fsl_lpspi_probe(struct platform_device *pdev) + ret = pm_runtime_get_sync(fsl_lpspi->dev); + if (ret < 0) { + dev_err(fsl_lpspi->dev, "failed to enable clock\n"); +- return ret; ++ goto out_controller_put; + } + + temp = readl(fsl_lpspi->base + IMX7ULP_PARAM); +-- +2.17.1 + +