From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Oleksii Moisieiev <Oleksii_Moisieiev@epam.com>,
Oleksii Moisieiev <oleksii_moisieiev@epam.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Juergen Gross <jgross@suse.com>, Sasha Levin <sashal@kernel.org>,
xen-devel@lists.xenproject.org
Subject: [PATCH AUTOSEL 6.1 21/53] xen/pvcalls: free active map buffer on pvcalls_front_free_map
Date: Mon, 16 Jan 2023 09:01:21 -0500 [thread overview]
Message-ID: <20230116140154.114951-21-sashal@kernel.org> (raw)
In-Reply-To: <20230116140154.114951-1-sashal@kernel.org>
From: Oleksii Moisieiev <Oleksii_Moisieiev@epam.com>
[ Upstream commit f57034cedeb6e00256313a2a6ee67f974d709b0b ]
Data buffer for active map is allocated in alloc_active_ring and freed
in free_active_ring function, which is used only for the error
cleanup. pvcalls_front_release is calling pvcalls_front_free_map which
ends foreign access for this buffer, but doesn't free allocated pages.
Call free_active_ring to clean all allocated resources.
Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Link: https://lore.kernel.org/r/6a762ee32dd655cbb09a4aa0e2307e8919761311.1671531297.git.oleksii_moisieiev@epam.com
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/xen/pvcalls-front.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/xen/pvcalls-front.c b/drivers/xen/pvcalls-front.c
index 1826e8e67125..9b569278788a 100644
--- a/drivers/xen/pvcalls-front.c
+++ b/drivers/xen/pvcalls-front.c
@@ -225,6 +225,8 @@ static irqreturn_t pvcalls_front_event_handler(int irq, void *dev_id)
return IRQ_HANDLED;
}
+static void free_active_ring(struct sock_mapping *map);
+
static void pvcalls_front_free_map(struct pvcalls_bedata *bedata,
struct sock_mapping *map)
{
@@ -240,7 +242,7 @@ static void pvcalls_front_free_map(struct pvcalls_bedata *bedata,
for (i = 0; i < (1 << PVCALLS_RING_ORDER); i++)
gnttab_end_foreign_access(map->active.ring->ref[i], NULL);
gnttab_end_foreign_access(map->active.ref, NULL);
- free_page((unsigned long)map->active.ring);
+ free_active_ring(map);
kfree(map);
}
--
2.35.1
next prev parent reply other threads:[~2023-01-16 14:05 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-16 14:01 [PATCH AUTOSEL 6.1 01/53] scsi: iscsi: Fix multiple iSCSI session unbind events sent to userspace Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 02/53] ASoC: SOF: pm: Set target state earlier Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 03/53] ASoC: SOF: pm: Always tear down pipelines before DSP suspend Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 04/53] ASoC: SOF: Add FW state to debugfs Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 05/53] ASoC: amd: yc: Add Razer Blade 14 2022 into DMI table Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 06/53] spi: cadence: Fix busy cycles calculation Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 07/53] cpufreq: CPPC: Add u64 casts to avoid overflowing Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 08/53] cpufreq: Add Tegra234 to cpufreq-dt-platdev blocklist Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 09/53] ASoC: mediatek: mt8186: support rt5682s_max98360 Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 10/53] ASoC: mediatek: mt8186: Add machine support for max98357a Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 11/53] ASoC: amd: yc: Add ASUS M5402RA into DMI table Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 12/53] ASoC: support machine driver with max98360 Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 13/53] kcsan: test: don't put the expect array on the stack Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 14/53] cpufreq: Add SM6375 to cpufreq-dt-platdev blocklist Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 15/53] ASoC: fsl_micfil: Correct the number of steps on SX controls Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 16/53] drm/msm/a6xx: Avoid gx gbit halt during rpm suspend Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 17/53] net: usb: cdc_ether: add support for Thales Cinterion PLS62-W modem Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 18/53] drm: Add orientation quirk for Lenovo ideapad D330-10IGL Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 19/53] s390/debug: add _ASM_S390_ prefix to header guard Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 20/53] s390: expicitly align _edata and _end symbols on page boundary Sasha Levin
2023-01-16 14:01 ` Sasha Levin [this message]
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 22/53] perf/x86/cstate: Add Meteor Lake support Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 23/53] perf/x86/msr: " Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 24/53] perf/x86/msr: Add Emerald Rapids Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 25/53] perf/x86/intel/uncore: " Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 26/53] arm64/mm: Define dummy pud_user_exec() when using 2-level page-table Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 27/53] nolibc: fix fd_set type Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 28/53] tools/nolibc: Fix S_ISxxx macros Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 29/53] tools/nolibc: fix missing includes causing build issues at -O0 Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 30/53] tools/nolibc: prevent gcc from making memset() loop over itself Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 31/53] cpufreq: armada-37xx: stop using 0 as NULL pointer Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 32/53] ASoC: fsl_ssi: Rename AC'97 streams to avoid collisions with AC'97 CODEC Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 33/53] ASoC: fsl-asoc-card: Fix naming of AC'97 CODEC widgets Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 34/53] ACPI: resource: Skip IRQ override on Asus Expertbook B2402CBA Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 35/53] drm/amdkfd: Add sync after creating vram bo Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 36/53] drm/amdkfd: Fix NULL pointer error for GC 11.0.1 on mGPU Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 37/53] cifs: fix potential memory leaks in session setup Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 38/53] spi: spidev: fix a race condition when accessing spidev->spi Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 39/53] spi: spidev: remove debug messages that access spidev->spi without locking Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 40/53] KVM: s390: interrupt: use READ_ONCE() before cmpxchg() Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 41/53] scsi: hisi_sas: Use abort task set to reset SAS disks when discovered Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 42/53] scsi: hisi_sas: Set a port invalid only if there are no devices attached when refreshing port id Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 43/53] r8152: add vendor/device ID pair for Microsoft Devkit Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 44/53] platform/x86: touchscreen_dmi: Add info for the CSL Panther Tab HD Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 45/53] platform/x86: asus-nb-wmi: Add alternate mapping for KEY_CAMERA Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 46/53] platform/x86: asus-nb-wmi: Add alternate mapping for KEY_SCREENLOCK Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 47/53] platform/x86: asus-wmi: Add quirk wmi_ignore_fan Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 48/53] platform/x86: asus-wmi: Ignore fan on E410MA Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 49/53] platform/x86: simatic-ipc: correct name of a model Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 50/53] platform/x86: simatic-ipc: add another model Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 51/53] lockref: stop doing cpu_relax in the cmpxchg loop Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 52/53] ata: pata_cs5535: Don't build on UML Sasha Levin
2023-01-16 14:01 ` [PATCH AUTOSEL 6.1 53/53] firmware: coreboot: Check size of table entry and use flex-array Sasha Levin
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=20230116140154.114951-21-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=Oleksii_Moisieiev@epam.com \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sstabellini@kernel.org \
--cc=stable@vger.kernel.org \
--cc=xen-devel@lists.xenproject.org \
/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
all inboxes | Powered by JetHome®