dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
  • [parent not found: <20200408115926.1467567-18-hch@lst.de>]
  • * Re: decruft the vmalloc API
           [not found] <20200408115926.1467567-1-hch@lst.de>
           [not found] ` <20200408115926.1467567-27-hch@lst.de>
           [not found] ` <20200408115926.1467567-18-hch@lst.de>
    @ 2020-04-08 12:25 ` Peter Zijlstra
           [not found] ` <20200408115926.1467567-20-hch@lst.de>
                       ` (11 subsequent siblings)
      14 siblings, 0 replies; 36+ messages in thread
    From: Peter Zijlstra @ 2020-04-08 12:25 UTC (permalink / raw)
      To: Christoph Hellwig
      Cc: linux-hyperv, David Airlie, dri-devel, linux-mm,
    	K. Y. Srinivasan, linux-arch, linux-s390, Wei Liu,
    	Stephen Hemminger, x86, Laura Abbott, Nitin Gupta, Haiyang Zhang,
    	linaro-mm-sig, bpf, linux-arm-kernel, Christophe Leroy,
    	Robin Murphy, linux-kernel, Minchan Kim, iommu, Sakari Ailus,
    	Andrew Morton, linuxppc-dev
    
    On Wed, Apr 08, 2020 at 01:58:58PM +0200, Christoph Hellwig wrote:
    > Hi all,
    > 
    > Peter noticed that with some dumb luck you can toast the kernel address
    > space with exported vmalloc symbols.
    > 
    > I used this as an opportunity to decruft the vmalloc.c API and make it
    > much more systematic.  This also removes any chance to create vmalloc
    > mappings outside the designated areas or using executable permissions
    > from modules.  Besides that it removes more than 300 lines of code.
    > 
    
    Looks great, thanks for doing this!
    
    Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    _______________________________________________
    dri-devel mailing list
    dri-devel@lists.freedesktop.org
    https://lists.freedesktop.org/mailman/listinfo/dri-devel
    
    ^ permalink raw reply	[flat|nested] 36+ messages in thread
  • [parent not found: <20200408115926.1467567-20-hch@lst.de>]
  • [parent not found: <20200408115926.1467567-19-hch@lst.de>]
  • * Re: [PATCH 02/28] staging: android: ion: use vmap instead of vm_map_ram
           [not found] <20200408115926.1467567-1-hch@lst.de>
                       ` (4 preceding siblings ...)
           [not found] ` <20200408115926.1467567-19-hch@lst.de>
    @ 2020-04-08 12:48 ` Hillf Danton
           [not found] ` <20200408115926.1467567-3-hch@lst.de>
                       ` (8 subsequent siblings)
      14 siblings, 0 replies; 36+ messages in thread
    From: Hillf Danton @ 2020-04-08 12:48 UTC (permalink / raw)
      To: Christoph Hellwig
      Cc: Christophe Leroy, linux-arch, linux-hyperv, linux-s390,
    	Peter Zijlstra, syzkaller-bugs, linux-kernel, dri-devel,
    	linaro-mm-sig, linux-mm, iommu, Andrew Morton, linuxppc-dev, bpf,
    	linux-arm-kernel
    
    
    On Wed,  8 Apr 2020 13:59:00 +0200
    > 
    > 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>
    > ---
    >  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 473b465724f1..a2d5c6df4b96 100644
    > --- a/drivers/staging/android/ion/ion_heap.c
    > +++ b/drivers/staging/android/ion/ion_heap.c
    > @@ -99,12 +99,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);
    
    A merge glitch?
    
    void *vmap(struct page **pages, unsigned int count,
    	   unsigned long flags, pgprot_t prot)
    >  
    >  	if (!addr)
    >  		return -ENOMEM;
    >  	memset(addr, 0, PAGE_SIZE * num);
    > -	vm_unmap_ram(addr, num);
    > +	vunmap(addr);
    >  
    >  	return 0;
    >  }
    > -- 
    > 2.25.1
    
    _______________________________________________
    dri-devel mailing list
    dri-devel@lists.freedesktop.org
    https://lists.freedesktop.org/mailman/listinfo/dri-devel
    
    ^ permalink raw reply	[flat|nested] 36+ messages in thread
  • [parent not found: <20200408115926.1467567-3-hch@lst.de>]
  • [parent not found: <20200408115926.1467567-28-hch@lst.de>]
  • [parent not found: <20200408115926.1467567-29-hch@lst.de>]
  • [parent not found: <20200408115926.1467567-10-hch@lst.de>]
  • [parent not found: <20200408115926.1467567-11-hch@lst.de>]
  • * Re: decruft the vmalloc API
           [not found] <20200408115926.1467567-1-hch@lst.de>
                       ` (10 preceding siblings ...)
           [not found] ` <20200408115926.1467567-11-hch@lst.de>
    @ 2020-04-08 16:03 ` Russell King - ARM Linux admin
           [not found] ` <20200408115926.1467567-26-hch@lst.de>
                       ` (2 subsequent siblings)
      14 siblings, 0 replies; 36+ messages in thread
    From: Russell King - ARM Linux admin @ 2020-04-08 16:03 UTC (permalink / raw)
      To: Christoph Hellwig
      Cc: linux-hyperv, David Airlie, dri-devel, linux-mm,
    	K. Y. Srinivasan, linux-arch, linux-s390, Wei Liu,
    	Stephen Hemminger, x86, Peter Zijlstra, Laura Abbott,
    	Nitin Gupta, Haiyang Zhang, linaro-mm-sig, bpf, linux-arm-kernel,
    	Christophe Leroy, Robin Murphy, linux-kernel, Minchan Kim, iommu,
    	Sakari Ailus, Andrew Morton, linuxppc-dev
    
    On Wed, Apr 08, 2020 at 01:58:58PM +0200, Christoph Hellwig wrote:
    > Hi all,
    > 
    > Peter noticed that with some dumb luck you can toast the kernel address
    > space with exported vmalloc symbols.
    > 
    > I used this as an opportunity to decruft the vmalloc.c API and make it
    > much more systematic.  This also removes any chance to create vmalloc
    > mappings outside the designated areas or using executable permissions
    > from modules.  Besides that it removes more than 300 lines of code.
    
    I haven't read all your patches yet.
    
    Have you tested it on 32-bit ARM, where the module area is located
    _below_ PAGE_OFFSET and outside of the vmalloc area?
    
    -- 
    RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
    FTTC broadband for 0.8mile line in suburbia: sync at 10.2Mbps down 587kbps up
    _______________________________________________
    dri-devel mailing list
    dri-devel@lists.freedesktop.org
    https://lists.freedesktop.org/mailman/listinfo/dri-devel
    
    ^ permalink raw reply	[flat|nested] 36+ messages in thread
  • [parent not found: <20200408115926.1467567-26-hch@lst.de>]
  • [parent not found: <20200408115926.1467567-21-hch@lst.de>]
  • [parent not found: <20200408115926.1467567-2-hch@lst.de>]

  • end of thread, other threads:[~2020-04-16 20:37 UTC | newest]
    
    Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
    -- links below jump to the message on this page --
         [not found] <20200408115926.1467567-1-hch@lst.de>
         [not found] ` <20200408115926.1467567-27-hch@lst.de>
    2020-04-08 12:18   ` [PATCH 26/28] arm64: use __vmalloc_node in arch_alloc_vmap_stack Mark Rutland
         [not found] ` <20200408115926.1467567-18-hch@lst.de>
    2020-04-08 12:21   ` [PATCH 17/28] mm: remove the prot argument from vm_map_ram Peter Zijlstra
    2020-04-09  0:39   ` Gao Xiang
    2020-04-08 12:25 ` decruft the vmalloc API Peter Zijlstra
         [not found] ` <20200408115926.1467567-20-hch@lst.de>
    2020-04-08 12:25   ` [PATCH 19/28] gpu/drm: remove the powerpc hack in drm_legacy_sg_alloc Daniel Vetter
    2020-04-09  8:54     ` Benjamin Herrenschmidt
    2020-04-09  9:41       ` Daniel Vetter
    2020-04-09 14:19         ` Alex Deucher
    2020-04-09 14:57           ` Daniel Vetter
    2020-04-09 22:56         ` Benjamin Herrenschmidt
    2020-04-10  8:11           ` Daniel Vetter
    2020-04-09 11:46       ` Gerhard Pircher
         [not found] ` <20200408115926.1467567-19-hch@lst.de>
    2020-04-08 12:38   ` [PATCH 18/28] mm: enforce that vmap can't map pages executable Mark Rutland
    2020-04-08 12:48 ` [PATCH 02/28] staging: android: ion: use vmap instead of vm_map_ram Hillf Danton
         [not found] ` <20200408115926.1467567-3-hch@lst.de>
    2020-04-08 13:27   ` Greg KH
         [not found] ` <20200408115926.1467567-28-hch@lst.de>
    2020-04-08 13:33   ` [PATCH 27/28] s390: use __vmalloc_node in alloc_vm_stack Christian Borntraeger
         [not found] ` <20200408115926.1467567-29-hch@lst.de>
    2020-04-08 13:44   ` [PATCH 28/28] s390: use __vmalloc_node in stack_alloc Christian Borntraeger
         [not found] ` <20200408115926.1467567-10-hch@lst.de>
    2020-04-08 15:00   ` [PATCH 09/28] mm: rename CONFIG_PGTABLE_MAPPING to CONFIG_ZSMALLOC_PGTABLE_MAPPING Randy Dunlap
    2020-04-09 15:59   ` Minchan Kim
         [not found] ` <20200408115926.1467567-11-hch@lst.de>
    2020-04-08 15:01   ` [PATCH 10/28] mm: only allow page table mappings for built-in zsmalloc Randy Dunlap
    2020-04-08 15:12     ` Peter Zijlstra
    2020-04-08 15:15       ` Matthew Wilcox
    2020-04-08 15:36         ` Randy Dunlap
         [not found]         ` <20200408153602.GA28081@lst.de>
    2020-04-08 15:37           ` Randy Dunlap
    2020-04-09 16:08   ` Minchan Kim
    2020-04-09 16:50     ` Peter Zijlstra
    2020-04-09 17:08       ` Minchan Kim
    2020-04-10  2:38         ` Sergey Senozhatsky
    2020-04-10 23:11           ` Minchan Kim
         [not found]             ` <20200411072052.GA31242@lst.de>
    2020-04-16 20:37               ` Minchan Kim
    2020-04-08 16:03 ` decruft the vmalloc API Russell King - ARM Linux admin
         [not found] ` <20200408115926.1467567-26-hch@lst.de>
    2020-04-09 22:25   ` [PATCH 25/28] mm: remove vmalloc_user_node_flags Andrii Nakryiko
    2020-04-13 20:03     ` Johannes Weiner
         [not found] ` <20200408115926.1467567-21-hch@lst.de>
    2020-04-10 20:39   ` [PATCH 20/28] mm: remove the pgprot argument to __vmalloc Michael Kelley
         [not found] ` <20200408115926.1467567-2-hch@lst.de>
    2020-04-09 15:52   ` [PATCH 01/28] x86/hyperv: use vmalloc_exec for the hypercall page Wei Liu
    2020-04-10 20:40   ` Michael Kelley
    

    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).