From: Andrew Morton <akpm@linux-foundation.org>
To: Andrey Konovalov <andreyknvl@gmail.com>
Cc: kernel test robot <lkp@intel.com>,
andrey.konovalov@linux.dev, Marco Elver <elver@google.com>,
oe-kbuild-all@lists.linux.dev,
Linux Memory Management List <linux-mm@kvack.org>,
Alexander Potapenko <glider@google.com>,
Dmitry Vyukov <dvyukov@google.com>,
Andrey Ryabinin <ryabinin.a.a@gmail.com>,
kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH mm] kasan: stop leaking stack trace handles
Date: Wed, 27 Dec 2023 14:10:05 -0800 [thread overview]
Message-ID: <20231227141005.14e278c3f08dd0d64004dbf7@linux-foundation.org> (raw)
In-Reply-To: <CA+fCnZfZMhkqOvsvavJ-YTddY4kniP+sWFZRYy+nd3+8_C9hPA@mail.gmail.com>
On Wed, 27 Dec 2023 22:42:40 +0100 Andrey Konovalov <andreyknvl@gmail.com> wrote:
> On Wed, Dec 27, 2023 at 10:23 PM Andrew Morton
> <akpm@linux-foundation.org> wrote:
> >
> > Thanks, I added this fix:
> >
> > --- a/mm/kasan/generic.c~kasan-stop-leaking-stack-trace-handles-fix
> > +++ a/mm/kasan/generic.c
> > @@ -503,7 +503,7 @@ void kasan_init_object_meta(struct kmem_
> > */
> > }
> >
> > -void release_alloc_meta(struct kasan_alloc_meta *meta)
> > +static void release_alloc_meta(struct kasan_alloc_meta *meta)
> > {
> > /* Evict the stack traces from stack depot. */
> > stack_depot_put(meta->alloc_track.stack);
> > @@ -514,7 +514,7 @@ void release_alloc_meta(struct kasan_all
> > __memset(meta, 0, sizeof(*meta));
> > }
> >
> > -void release_free_meta(const void *object, struct kasan_free_meta *meta)
> > +static void release_free_meta(const void *object, struct kasan_free_meta *meta)
> > {
> > /* Check if free meta is valid. */
> > if (*(u8 *)kasan_mem_to_shadow(object) != KASAN_SLAB_FREE_META)
> > _
> >
>
> Could you mark them as "static inline" even?
That's rather old-fashioned. Nowadays gcc is supposed to work out
whether or not to inline things, and we override that with noinline and
__always_inline.
next prev parent reply other threads:[~2023-12-27 22:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-26 22:51 [PATCH mm] kasan: stop leaking stack trace handles andrey.konovalov
2023-12-27 18:19 ` kernel test robot
2023-12-27 21:23 ` Andrew Morton
2023-12-27 21:42 ` Andrey Konovalov
2023-12-27 22:10 ` Andrew Morton [this message]
2023-12-27 22:28 ` kernel test robot
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=20231227141005.14e278c3f08dd0d64004dbf7@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=andrey.konovalov@linux.dev \
--cc=andreyknvl@gmail.com \
--cc=dvyukov@google.com \
--cc=elver@google.com \
--cc=glider@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=ryabinin.a.a@gmail.com \
/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).