From: Andrey Ryabinin <aryabinin@virtuozzo.com>
To: Alexander Potapenko <glider@google.com>,
adech.fo@gmail.com, dvyukov@google.com, cl@linux.com,
akpm@linux-foundation.org, kcc@google.com
Cc: kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org,
linux-mm@kvack.org
Subject: Re: [PATCH v2 1/2] mm, kasan: don't call kasan_krealloc() from ksize().
Date: Fri, 15 Apr 2016 18:58:39 +0300 [thread overview]
Message-ID: <57110FAF.8070401@virtuozzo.com> (raw)
In-Reply-To: <2126fe9ca8c3a4698c0ad7aae652dce28e261182.1460545373.git.glider@google.com>
On 04/13/2016 02:20 PM, Alexander Potapenko wrote:
> Instead of calling kasan_krealloc(), which replaces the memory allocation
> stack ID (if stack depot is used), just unpoison the whole memory chunk.
>
> Signed-off-by: Alexander Potapenko <glider@google.com>
Acked-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
> ---
> v2: - splitted v1 into two patches
> ---
> mm/slab.c | 2 +-
> mm/slub.c | 5 +++--
> 2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/mm/slab.c b/mm/slab.c
> index 17e2848..de46319 100644
> --- a/mm/slab.c
> +++ b/mm/slab.c
> @@ -4324,7 +4324,7 @@ size_t ksize(const void *objp)
> /* We assume that ksize callers could use the whole allocated area,
> * so we need to unpoison this area.
> */
> - kasan_krealloc(objp, size, GFP_NOWAIT);
> + kasan_unpoison_shadow(objp, size);
>
> return size;
> }
> diff --git a/mm/slub.c b/mm/slub.c
> index 4dbb109e..62194e2 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -3635,8 +3635,9 @@ size_t ksize(const void *object)
> {
> size_t size = __ksize(object);
> /* We assume that ksize callers could use whole allocated area,
> - so we need unpoison this area. */
> - kasan_krealloc(object, size, GFP_NOWAIT);
> + * so we need to unpoison this area.
> + */
> + kasan_unpoison_shadow(object, size);
> return size;
> }
> EXPORT_SYMBOL(ksize);
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2016-04-15 15:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-13 11:20 [PATCH v2 1/2] mm, kasan: don't call kasan_krealloc() from ksize() Alexander Potapenko
2016-04-13 11:20 ` [PATCH v2 2/2] mm, kasan: add a ksize() test Alexander Potapenko
2016-04-15 15:59 ` Andrey Ryabinin
2016-04-15 15:58 ` Andrey Ryabinin [this message]
2016-04-22 21:32 ` [PATCH v2 1/2] mm, kasan: don't call kasan_krealloc() from ksize() Andrew Morton
2016-04-28 11:31 ` Alexander Potapenko
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=57110FAF.8070401@virtuozzo.com \
--to=aryabinin@virtuozzo.com \
--cc=adech.fo@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=dvyukov@google.com \
--cc=glider@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=kcc@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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).