linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Konovalov <andreyknvl@gmail.com>
To: Marco Elver <elver@google.com>
Cc: andrey.konovalov@linux.dev,
	Andrew Morton <akpm@linux-foundation.org>,
	 Juntong Deng <juntong.deng@outlook.com>,
	Alexander Potapenko <glider@google.com>,
	 Dmitry Vyukov <dvyukov@google.com>,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	kasan-dev@googlegroups.com,  linux-mm@kvack.org,
	linux-kernel@vger.kernel.org,
	 Andrey Konovalov <andreyknvl@google.com>
Subject: Re: [PATCH mm 4/4] kasan: simplify kasan_complete_mode_report_info for tag-based modes
Date: Thu, 21 Dec 2023 21:22:27 +0100	[thread overview]
Message-ID: <CA+fCnZdovMDygNE-ACEd++4Q23BAHp5QKaj6YhD929vTAhEDsQ@mail.gmail.com> (raw)
In-Reply-To: <CANpmjNMJM0zp9qmxh0MkAfKTLgzkcxyraGMp6JKSf9YquW4WMg@mail.gmail.com>

On Thu, Dec 21, 2023 at 9:14 PM Marco Elver <elver@google.com> wrote:
>
> On Thu, 21 Dec 2023 at 19:35, <andrey.konovalov@linux.dev> wrote:
> >
> > From: Andrey Konovalov <andreyknvl@google.com>
> >
> > memcpy the alloc/free tracks when collecting the information about a bad
> > access instead of copying fields one by one.
> >
> > Fixes: 5d4c6ac94694 ("kasan: record and report more information")
> > Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
>
> Reviewed-by: Marco Elver <elver@google.com>
>
> > ---
> >  mm/kasan/report_tags.c | 23 ++++-------------------
> >  1 file changed, 4 insertions(+), 19 deletions(-)
> >
> > diff --git a/mm/kasan/report_tags.c b/mm/kasan/report_tags.c
> > index 688b9d70b04a..d15f8f580e2c 100644
> > --- a/mm/kasan/report_tags.c
> > +++ b/mm/kasan/report_tags.c
> > @@ -27,15 +27,6 @@ static const char *get_common_bug_type(struct kasan_report_info *info)
> >         return "invalid-access";
> >  }
> >
> > -#ifdef CONFIG_KASAN_EXTRA_INFO
> > -static void kasan_complete_extra_report_info(struct kasan_track *track,
> > -                                        struct kasan_stack_ring_entry *entry)
> > -{
> > -       track->cpu = entry->track.cpu;
> > -       track->timestamp = entry->track.timestamp;
> > -}
> > -#endif /* CONFIG_KASAN_EXTRA_INFO */
> > -
> >  void kasan_complete_mode_report_info(struct kasan_report_info *info)
> >  {
> >         unsigned long flags;
> > @@ -80,11 +71,8 @@ void kasan_complete_mode_report_info(struct kasan_report_info *info)
> >                         if (free_found)
> >                                 break;
> >
> > -                       info->free_track.pid = entry->track.pid;
> > -                       info->free_track.stack = entry->track.stack;
> > -#ifdef CONFIG_KASAN_EXTRA_INFO
> > -                       kasan_complete_extra_report_info(&info->free_track, entry);
> > -#endif /* CONFIG_KASAN_EXTRA_INFO */
> > +                       memcpy(&info->free_track, &entry->track,
> > +                              sizeof(info->free_track));
>
> Not sure why the line break is necessary.

Ah, just the old desire to use 80-column line limit :)

Let's keep this as this for now, but I'll fix it if I end up sending
v2 of this series.

Thanks!


  reply	other threads:[~2023-12-21 20:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-21 18:35 [PATCH mm 1/4] kasan: clean up kasan_cache_create andrey.konovalov
2023-12-21 18:35 ` [PATCH mm 2/4] kasan: reuse kasan_track in kasan_stack_ring_entry andrey.konovalov
2023-12-21 20:10   ` Marco Elver
2023-12-21 20:19     ` Andrey Konovalov
2023-12-21 18:35 ` [PATCH mm 3/4] kasan: simplify saving extra info into tracks andrey.konovalov
2023-12-21 20:11   ` Marco Elver
2023-12-21 20:21     ` Andrey Konovalov
2023-12-21 18:35 ` [PATCH mm 4/4] kasan: simplify kasan_complete_mode_report_info for tag-based modes andrey.konovalov
2023-12-21 20:13   ` Marco Elver
2023-12-21 20:22     ` Andrey Konovalov [this message]
2023-12-21 20:08 ` [PATCH mm 1/4] kasan: clean up kasan_cache_create Marco Elver

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=CA+fCnZdovMDygNE-ACEd++4Q23BAHp5QKaj6YhD929vTAhEDsQ@mail.gmail.com \
    --to=andreyknvl@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=andrey.konovalov@linux.dev \
    --cc=andreyknvl@google.com \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=glider@google.com \
    --cc=juntong.deng@outlook.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --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