From: Andrey Ryabinin <aryabinin@virtuozzo.com>
To: Daniel Axtens <dja@axtens.net>,
kasan-dev@googlegroups.com, linux-mm@kvack.org, x86@kernel.org,
glider@google.com, linux-kernel@vger.kernel.org,
dvyukov@google.com
Cc: Qian Cai <cai@lca.pw>
Subject: Re: [PATCH] kasan: support vmalloc backing of vm_map_ram()
Date: Wed, 4 Dec 2019 23:44:29 +0300 [thread overview]
Message-ID: <cac9cbcf-4286-ae34-d150-79ea81a366b0@virtuozzo.com> (raw)
In-Reply-To: <20191129154519.30964-1-dja@axtens.net>
On 11/29/19 6:45 PM, Daniel Axtens wrote:
> @@ -1826,7 +1842,15 @@ void *vm_map_ram(struct page **pages, unsigned int count, int node, pgprot_t pro
>
> addr = va->va_start;
> mem = (void *)addr;
> +
> + if (kasan_populate_vmalloc_area(size, mem)) {
> + vm_unmap_ram(mem, count);
> + return NULL;
> + }
> }
> +
> + kasan_unpoison_shadow(mem, size);
> +
This probably gonna explode on CONFIG_KASAN=y && CONFIG_KASAN_VMALLOC=n
I've sent alternative patch which fixes vm_map_ram() and also makes the code a bit easier to follow in my opinion.
> if (vmap_page_range(addr, addr + size, prot, pages) < 0) {
> vm_unmap_ram(mem, count);
> return NULL;
>
prev parent reply other threads:[~2019-12-04 20:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-29 15:45 Daniel Axtens
2019-12-04 12:01 ` Daniel Axtens
2019-12-04 20:44 ` Andrey Ryabinin [this message]
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=cac9cbcf-4286-ae34-d150-79ea81a366b0@virtuozzo.com \
--to=aryabinin@virtuozzo.com \
--cc=cai@lca.pw \
--cc=dja@axtens.net \
--cc=dvyukov@google.com \
--cc=glider@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=x86@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