From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
patches@lists.linux.dev,
Wojciech Drewek <wojciech.drewek@intel.com>,
Mateusz Palczewski <mateusz.palczewski@intel.com>,
Jacob Keller <jacob.e.keller@intel.com>,
"David S. Miller" <davem@davemloft.net>,
Sasha Levin <sashal@kernel.org>,
Arpana Arland <arpanax.arland@intel.com>
Subject: [PATCH 4.14 05/48] igb: Fix potential memory leak in igb_add_ethtool_nfc_entry
Date: Mon, 6 Nov 2023 14:02:56 +0100 [thread overview]
Message-ID: <20231106130258.046357408@linuxfoundation.org> (raw)
In-Reply-To: <20231106130257.862199836@linuxfoundation.org>
4.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mateusz Palczewski <mateusz.palczewski@intel.com>
[ Upstream commit 8c0b48e01daba5ca58f939a8425855d3f4f2ed14 ]
Add check for return of igb_update_ethtool_nfc_entry so that in case
of any potential errors the memory alocated for input will be freed.
Fixes: 0e71def25281 ("igb: add support of RX network flow classification")
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
Tested-by: Arpana Arland <arpanax.arland@intel.com> (A Contingent worker at Intel)
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/igb/igb_ethtool.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c
index 77108b0a07f51..c8b5650b7eac5 100644
--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
@@ -2951,11 +2951,15 @@ static int igb_add_ethtool_nfc_entry(struct igb_adapter *adapter,
if (err)
goto err_out_w_lock;
- igb_update_ethtool_nfc_entry(adapter, input, input->sw_idx);
+ err = igb_update_ethtool_nfc_entry(adapter, input, input->sw_idx);
+ if (err)
+ goto err_out_input_filter;
spin_unlock(&adapter->nfc_lock);
return 0;
+err_out_input_filter:
+ igb_erase_filter(adapter, input);
err_out_w_lock:
spin_unlock(&adapter->nfc_lock);
err_out:
--
2.42.0
next prev parent reply other threads:[~2023-11-06 13:06 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-06 13:02 [PATCH 4.14 00/48] 4.14.329-rc1 review Greg Kroah-Hartman
2023-11-06 13:02 ` [PATCH 4.14 01/48] mcb: Return actual parsed size when reading chameleon table Greg Kroah-Hartman
2023-11-06 13:02 ` [PATCH 4.14 02/48] mcb-lpc: Reallocate memory region to avoid memory overlapping Greg Kroah-Hartman
2023-11-06 13:02 ` [PATCH 4.14 03/48] virtio_balloon: Fix endless deflation and inflation on arm64 Greg Kroah-Hartman
2023-11-06 13:02 ` [PATCH 4.14 04/48] treewide: Spelling fix in comment Greg Kroah-Hartman
2023-11-06 13:02 ` Greg Kroah-Hartman [this message]
2023-11-06 13:02 ` [PATCH 4.14 06/48] r8152: Increase USB control msg timeout to 5000ms as per spec Greg Kroah-Hartman
2023-11-06 13:02 ` [PATCH 4.14 07/48] tcp: fix wrong RTO timeout when received SACK reneging Greg Kroah-Hartman
2023-11-06 13:02 ` [PATCH 4.14 08/48] gtp: uapi: fix GTPA_MAX Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 09/48] i40e: Fix wrong check for I40E_TXR_FLAGS_WB_ON_ITR Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 10/48] i2c: muxes: i2c-mux-pinctrl: Use of_get_i2c_adapter_by_node() Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 11/48] i2c: muxes: i2c-mux-gpmux: " Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 12/48] i2c: muxes: i2c-demux-pinctrl: " Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 13/48] perf/core: Fix potential NULL deref Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 14/48] NFS: Dont call generic_error_remove_page() while holding locks Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 15/48] ARM: 8933/1: replace Sun/Solaris style flag on section directive Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 16/48] drm/dp_mst: Fix NULL deref in get_mst_branch_device_by_guid_helper() Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 17/48] kobject: Fix slab-out-of-bounds in fill_kobj_path() Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 18/48] f2fs: fix to do sanity check on inode type during garbage collection Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 19/48] nfsd: lock_rename() needs both directories to live on the same fs Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 20/48] x86/i8259: Skip probing when ACPI/MADT advertises PCAT compatibility Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 21/48] x86/mm: Simplify RESERVE_BRK() Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 22/48] x86/mm: Fix RESERVE_BRK() for older binutils Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 23/48] driver: platform: Add helper for safer setting of driver_override Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 24/48] rpmsg: Fix kfree() of static memory on setting driver_override Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 25/48] rpmsg: Fix calling device_lock() on non-initialized device Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 26/48] rpmsg: glink: Release driver_override Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 27/48] rpmsg: Fix possible refcount leak in rpmsg_register_device_override() Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 28/48] x86: Fix .brk attribute in linker script Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 29/48] ASoC: simple-card: fixup asoc_simple_probe() error handling Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 30/48] irqchip/stm32-exti: add missing DT IRQ flag translation Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 31/48] dmaengine: ste_dma40: Fix PM disable depth imbalance in d40_probe Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 32/48] Input: synaptics-rmi4 - handle reset delay when using SMBus trsnsport Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 33/48] fbdev: atyfb: only use ioremap_uc() on i386 and ia64 Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 34/48] netfilter: nfnetlink_log: silence bogus compiler warning Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 35/48] ASoC: rt5650: fix the wrong result of key button Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 36/48] fbdev: uvesafb: Call cn_del_callback() at the end of uvesafb_exit() Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 37/48] scsi: mpt3sas: Fix in error path Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 38/48] platform/x86: asus-wmi: Change ASUS_WMI_BRN_DOWN code from 0x20 to 0x2e Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 39/48] net: chelsio: cxgb4: add an error code check in t4_load_phy_fw Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 40/48] ata: ahci: fix enum constants for gcc-13 Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 41/48] remove the sx8 block driver Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 42/48] vc_screen: move load of struct vc_data pointer in vcs_read() to avoid UAF Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 43/48] PCI: Prevent xHCI driver from claiming AMD VanGogh USB3 DRD device Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 44/48] usb: storage: set 1.50 as the lower bcdDevice for older "Super Top" compatibility Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 45/48] tty: 8250: Remove UC-257 and UC-431 Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 46/48] tty: 8250: Add support for additional Brainboxes UC cards Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 47/48] tty: 8250: Add support for Brainboxes UP cards Greg Kroah-Hartman
2023-11-06 13:03 ` [PATCH 4.14 48/48] tty: 8250: Add support for Intashield IS-100 Greg Kroah-Hartman
2023-11-06 21:34 ` [PATCH 4.14 00/48] 4.14.329-rc1 review Pavel Machek
2023-11-07 11:42 ` Jon Hunter
2023-11-07 15:32 ` Harshit Mogalapalli
2023-11-07 18:52 ` Guenter Roeck
2023-11-07 19:01 ` Naresh Kamboju
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231106130258.046357408@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=arpanax.arland@intel.com \
--cc=davem@davemloft.net \
--cc=jacob.e.keller@intel.com \
--cc=mateusz.palczewski@intel.com \
--cc=patches@lists.linux.dev \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
--cc=wojciech.drewek@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox