Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.2002031716440.1668@www.lameter.com>
Date: Mon, 3 Feb 2020 17:20:02 +0000 (UTC)
From: Christopher Lameter <cl@...ux.com>
To: Kees Cook <keescook@...omium.org>
cc: Jann Horn <jannh@...gle.com>, 
    Christian Borntraeger <borntraeger@...ibm.com>, 
    Christoph Hellwig <hch@...radead.org>, Jiri Slaby <jslaby@...e.cz>, 
    Julian Wiedmann <jwi@...ux.ibm.com>, Ursula Braun <ubraun@...ux.ibm.com>, 
    Alexander Viro <viro@...iv.linux.org.uk>, 
    kernel list <linux-kernel@...r.kernel.org>, 
    David Windsor <dave@...lcore.net>, Pekka Enberg <penberg@...nel.org>, 
    David Rientjes <rientjes@...gle.com>, Joonsoo Kim <iamjoonsoo.kim@....com>, 
    Andrew Morton <akpm@...ux-foundation.org>, Linux-MM <linux-mm@...ck.org>, 
    linux-xfs@...r.kernel.org, Linus Torvalds <torvalds@...ux-foundation.org>, 
    Andy Lutomirski <luto@...nel.org>, "David S. Miller" <davem@...emloft.net>, 
    Laura Abbott <labbott@...hat.com>, Mark Rutland <mark.rutland@....com>, 
    "Martin K. Petersen" <martin.petersen@...cle.com>, 
    Paolo Bonzini <pbonzini@...hat.com>, 
    Christoffer Dall <christoffer.dall@...aro.org>, 
    Dave Kleikamp <dave.kleikamp@...cle.com>, Jan Kara <jack@...e.cz>, 
    Luis de Bethencourt <luisbg@...nel.org>, 
    Marc Zyngier <marc.zyngier@....com>, Rik van Riel <riel@...hat.com>, 
    Matthew Garrett <mjg59@...gle.com>, 
    linux-fsdevel <linux-fsdevel@...r.kernel.org>, 
    linux-arch <linux-arch@...r.kernel.org>, 
    Network Development <netdev@...r.kernel.org>, 
    Kernel Hardening <kernel-hardening@...ts.openwall.com>, 
    Vlastimil Babka <vbabka@...e.cz>, Michal Kubecek <mkubecek@...e.cz>
Subject: Re: [PATCH 09/38] usercopy: Mark kmalloc caches
 as usercopy caches

On Sat, 1 Feb 2020, Kees Cook wrote:
>
> I can't find where the address limit for dma-kmalloc is implemented.

include/linux/mmzones.h

enum zone_type {
        /*
         * ZONE_DMA and ZONE_DMA32 are used when there are peripherals not able
         * to DMA to all of the addressable memory (ZONE_NORMAL).
         * On architectures where this area covers the whole 32 bit address
         * space ZONE_DMA32 is used. ZONE_DMA is left for the ones with smaller
         * DMA addressing constraints. This distinction is important as a 32bit
         * DMA mask is assumed when ZONE_DMA32 is defined. Some 64-bit
         * platforms may need both zones as they support peripherals with
         * different DMA addressing limitations.
         *
         * Some examples:
         *
         *  - i386 and x86_64 have a fixed 16M ZONE_DMA and ZONE_DMA32 for the
         *    rest of the lower 4G.
         *
         *  - arm only uses ZONE_DMA, the size, up to 4G, may vary depending on
         *    the specific device.
         *
         *  - arm64 has a fixed 1G ZONE_DMA and ZONE_DMA32 for the rest of the
         *    lower 4G.
         *
         *  - powerpc only uses ZONE_DMA, the size, up to 2G, may vary
         *    depending on the specific device.
         *
         *  - s390 uses ZONE_DMA fixed to the lower 2G.
         *
         *  - ia64 and riscv only use ZONE_DMA32.
         *
         *  - parisc uses neither.
         */
#ifdef CONFIG_ZONE_DMA
        ZONE_DMA,
#endif
#ifdef CONFIG_ZONE_DMA32
        ZONE_DMA32,
#endif
        /*
         * Normal addressable memory is in ZONE_NORMAL. DMA operations can
be
         * performed on pages in ZONE_NORMAL if the DMA devices support
         * transfers to all addressable memory.
         */
        ZONE_NORMAL,
#ifdef CONFIG_HIGHMEM
        /*
         * A memory area that is only addressable by the kernel through
         * mapping portions into its own address space. This is for example
         * used by i386 to allow the kernel to address the memory beyond
         * 900MB. The kernel will set up special mappings (page
         * table entries on i386) for each page that the kernel needs to
         * access.
         */
        ZONE_HIGHMEM,
#endif
        ZONE_MOVABLE,
#ifdef CONFIG_ZONE_DEVICE
        ZONE_DEVICE,
#endif
        __MAX_NR_ZONES

};

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.