stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Christoph Hellwig <hch@lst.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Christophe Leroy <christophe.leroy@c-s.fr>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	David Airlie <airlied@linux.ie>, Gao Xiang <xiang@kernel.org>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Laura Abbott <labbott@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Michael Kelley <mikelley@microsoft.com>,
	Minchan Kim <minchan@kernel.org>, Nitin Gupta <ngupta@vflare.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	Wei Liu <wei.liu@kernel.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Paul Mackerras <paulus@ozlabs.org>,
	Vasily Gorbik <gor@linux.ibm.com>, Will Deacon <will@kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Sasha Levin <sashal@kernel.org>,
	devel@driverdev.osuosl.org, dri-devel@lists.freedesktop.org,
	linaro-mm-sig@lists.linaro.org
Subject: [PATCH AUTOSEL 4.14 22/72] staging: android: ion: use vmap instead of vm_map_ram
Date: Mon,  8 Jun 2020 19:24:10 -0400	[thread overview]
Message-ID: <20200608232500.3369581-22-sashal@kernel.org> (raw)
In-Reply-To: <20200608232500.3369581-1-sashal@kernel.org>

From: Christoph Hellwig <hch@lst.de>

[ Upstream commit 5bf9917452112694b2c774465ee4dbe441c84b77 ]

vm_map_ram can keep mappings around after the vm_unmap_ram.  Using that
with non-PAGE_KERNEL mappings can lead to all kinds of aliasing issues.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: David Airlie <airlied@linux.ie>
Cc: Gao Xiang <xiang@kernel.org>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Michael Kelley <mikelley@microsoft.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Wei Liu <wei.liu@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Paul Mackerras <paulus@ozlabs.org>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Will Deacon <will@kernel.org>
Link: http://lkml.kernel.org/r/20200414131348.444715-4-hch@lst.de
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/staging/android/ion/ion_heap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/android/ion/ion_heap.c b/drivers/staging/android/ion/ion_heap.c
index babbd94c32d9..33a9777e7a99 100644
--- a/drivers/staging/android/ion/ion_heap.c
+++ b/drivers/staging/android/ion/ion_heap.c
@@ -105,12 +105,12 @@ int ion_heap_map_user(struct ion_heap *heap, struct ion_buffer *buffer,
 
 static int ion_heap_clear_pages(struct page **pages, int num, pgprot_t pgprot)
 {
-	void *addr = vm_map_ram(pages, num, -1, pgprot);
+	void *addr = vmap(pages, num, VM_MAP, pgprot);
 
 	if (!addr)
 		return -ENOMEM;
 	memset(addr, 0, PAGE_SIZE * num);
-	vm_unmap_ram(addr, num);
+	vunmap(addr);
 
 	return 0;
 }
-- 
2.25.1


  parent reply	other threads:[~2020-06-08 23:49 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-08 23:23 [PATCH AUTOSEL 4.14 01/72] ath9x: Fix stack-out-of-bounds Write in ath9k_hif_usb_rx_cb Sasha Levin
2020-06-08 23:23 ` [PATCH AUTOSEL 4.14 02/72] ath9k: Fix use-after-free Write in ath9k_htc_rx_msg Sasha Levin
2020-06-08 23:23 ` [PATCH AUTOSEL 4.14 03/72] drm: bridge: adv7511: Extend list of audio sample rates Sasha Levin
2020-06-08 23:23 ` [PATCH AUTOSEL 4.14 04/72] crypto: ccp -- don't "select" CONFIG_DMADEVICES Sasha Levin
2020-06-08 23:23 ` [PATCH AUTOSEL 4.14 05/72] media: si2157: Better check for running tuner in init Sasha Levin
2020-06-08 23:23 ` [PATCH AUTOSEL 4.14 06/72] objtool: Ignore empty alternatives Sasha Levin
2020-06-08 23:23 ` [PATCH AUTOSEL 4.14 07/72] spi: pxa2xx: Apply CS clk quirk to BXT Sasha Levin
2020-06-08 23:23 ` [PATCH AUTOSEL 4.14 08/72] net: ena: fix error returning in ena_com_get_hash_function() Sasha Levin
2020-06-08 23:23 ` [PATCH AUTOSEL 4.14 09/72] spi: dw: Zero DMA Tx and Rx configurations on stack Sasha Levin
2020-06-08 23:23 ` [PATCH AUTOSEL 4.14 10/72] ixgbe: Fix XDP redirect on archs with PAGE_SIZE above 4K Sasha Levin
2020-06-08 23:23 ` [PATCH AUTOSEL 4.14 11/72] MIPS: Loongson: Build ATI Radeon GPU driver as module Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 12/72] Bluetooth: Add SCO fallback for invalid LMP parameters error Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 13/72] kgdb: Prevent infinite recursive entries to the debugger Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 14/72] spi: dw: Enable interrupts in accordance with DMA xfer mode Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 15/72] clocksource: dw_apb_timer: Make CPU-affiliation being optional Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 16/72] clocksource: dw_apb_timer_of: Fix missing clockevent timers Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 17/72] btrfs: do not ignore error from btrfs_next_leaf() when inserting checksums Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 18/72] ARM: 8978/1: mm: make act_mm() respect THREAD_SIZE Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 19/72] spi: dw: Fix Rx-only DMA transfers Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 20/72] x86/kvm/hyper-v: Explicitly align hcall param for kvm_hyperv_exit Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 21/72] net: vmxnet3: fix possible buffer overflow caused by bad DMA value in vmxnet3_get_rss() Sasha Levin
2020-06-08 23:24 ` Sasha Levin [this message]
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 23/72] ath9k: Fix use-after-free Read in ath9k_wmi_ctrl_rx Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 24/72] ath9k: Fix general protection fault in ath9k_hif_usb_rx_cb Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 25/72] brcmfmac: fix wrong location to get firmware feature Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 26/72] tools api fs: Make xxx__mountpoint() more scalable Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 27/72] e1000: Distribute switch variables for initialization Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 28/72] dt-bindings: display: mediatek: control dpi pins mode to avoid leakage Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 29/72] audit: fix a net reference leak in audit_send_reply() Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 30/72] media: dvb: return -EREMOTEIO on i2c transfer failure Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 31/72] media: platform: fcp: Set appropriate DMA parameters Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 32/72] MIPS: Make sparse_init() using top-down allocation Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 33/72] audit: fix a net reference leak in audit_list_rules_send() Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 34/72] netfilter: nft_nat: return EOPNOTSUPP if type or flags are not supported Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 35/72] net: bcmgenet: set Rx mode before starting netif Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 36/72] lib/mpi: Fix 64-bit MIPS build with Clang Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 37/72] perf: Add cond_resched() to task_function_call() Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 38/72] exit: Move preemption fixup up, move blocking operations down Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 39/72] net: lpc-enet: fix error return code in lpc_mii_init() Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 40/72] media: cec: silence shift wrapping warning in __cec_s_log_addrs() Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 41/72] net: allwinner: Fix use correct return type for ndo_start_xmit() Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 42/72] powerpc/spufs: fix copy_to_user while atomic Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 43/72] ath9k_htc: Silence undersized packet warnings Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 44/72] Crypto/chcr: fix for ccm(aes) failed test Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 45/72] MIPS: Truncate link address into 32bit for 32bit kernel Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 46/72] mips: cm: Fix an invalid error code of INTVN_*_ERR Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 47/72] kgdb: Fix spurious true from in_dbg_master() Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 48/72] nvme: refine the Qemu Identify CNS quirk Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 49/72] wcn36xx: Fix error handling path in 'wcn36xx_probe()' Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 50/72] net: qed*: Reduce RX and TX default ring count when running inside kdump kernel Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 51/72] md: don't flush workqueue unconditionally in md_open Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 52/72] rtlwifi: Fix a double free in _rtl_usb_tx_urb_setup() Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 53/72] mwifiex: Fix memory corruption in dump_station Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 54/72] x86/boot: Correct relocation destination on old linkers Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 55/72] mips: MAAR: Use more precise address mask Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 56/72] mips: Add udelay lpj numbers adjustment Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 57/72] x86/mm: Stop printing BRK addresses Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 58/72] m68k: mac: Don't call via_flush_cache() on Mac IIfx Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 59/72] macvlan: Skip loopback packets in RX handler Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 60/72] PCI: Don't disable decoding when mmio_always_on is set Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 61/72] MIPS: Fix IRQ tracing when call handle_fpe() and handle_msa_fpe() Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 62/72] xfs: gut error handling in xfs_trans_unreserve_and_mod_sb() Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 63/72] mmc: sdhci-msm: Set SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 quirk Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 64/72] staging: greybus: sdio: Respect the cmd->busy_timeout from the mmc core Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 65/72] mmc: via-sdmmc: " Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 66/72] ixgbe: fix signed-integer-overflow warning Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 67/72] mmc: sdhci-esdhc-imx: fix the mask for tuning start point Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 68/72] spi: dw: Return any value retrieved from the dma_transfer callback Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 69/72] cpuidle: Fix three reference count leaks Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 70/72] platform/x86: hp-wmi: Convert simple_strtoul() to kstrtou32() Sasha Levin
2020-06-08 23:24 ` [PATCH AUTOSEL 4.14 71/72] vxlan: Avoid infinite loop when suppressing NS messages with invalid options Sasha Levin
2020-06-08 23:25 ` [PATCH AUTOSEL 4.14 72/72] string.h: fix incompatibility between FORTIFY_SOURCE and KASAN Sasha Levin
2020-06-08 23:46   ` Daniel Axtens
2020-06-09 11:20     ` Pavel Machek
2020-06-09 11:54       ` Greg KH
2020-06-09 13:55         ` Pavel Machek

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=20200608232500.3369581-22-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=airlied@linux.ie \
    --cc=akpm@linux-foundation.org \
    --cc=benh@kernel.crashing.org \
    --cc=borntraeger@de.ibm.com \
    --cc=catalin.marinas@arm.com \
    --cc=christophe.leroy@c-s.fr \
    --cc=daniel.vetter@ffwll.ch \
    --cc=devel@driverdev.osuosl.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gor@linux.ibm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=haiyangz@microsoft.com \
    --cc=hannes@cmpxchg.org \
    --cc=hch@lst.de \
    --cc=heiko.carstens@de.ibm.com \
    --cc=kys@microsoft.com \
    --cc=labbott@redhat.com \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mikelley@microsoft.com \
    --cc=minchan@kernel.org \
    --cc=ngupta@vflare.org \
    --cc=paulus@ozlabs.org \
    --cc=peterz@infradead.org \
    --cc=robin.murphy@arm.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=stable@vger.kernel.org \
    --cc=sthemmin@microsoft.com \
    --cc=sumit.semwal@linaro.org \
    --cc=torvalds@linux-foundation.org \
    --cc=wei.liu@kernel.org \
    --cc=will@kernel.org \
    --cc=xiang@kernel.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;
as well as URLs for NNTP newsgroup(s).