On Fri, Aug 30, 2024 at 10:08 AM <devel-requ...@lists.crash-utility.osci.io>
wrote:

> Date: Fri, 30 Aug 2024 10:59:44 +1200
> From: Tao Liu <l...@redhat.com>
> Subject: [Crash-utility] Re: [Crash-utility][PATCH] “kmem address” not
>         working properly when redzone is enabled
> To: "Aureau, Georges (Kernel Tools ERT)" <georges.aur...@hpe.com>
> Cc: "devel@lists.crash-utility.osci.io"
>         <devel@lists.crash-utility.osci.io>
> Message-ID:
>         <
> cao7dbbv96ys8sq1u00b2x1l9scyeuagqkan6gb4udx-xbnz...@mail.gmail.com>
> Content-Type: text/plain; charset="UTF-8"
>
> Hi Georges
>
> On Thu, Aug 29, 2024 at 9:55 PM Aureau, Georges (Kernel Tools ERT)
> <georges.aur...@hpe.com> wrote:
> >
> > Crash “kmem address” not working properly when redzone is enabled.
> >
> > When "slub_debug" is enabled with redzoning, "kmem address" does not
> work properly.
> > The "red_left_pad" member within "struct kmem_cache" is currently an
> "unsigned int",
> > it used to be an "int", but it never was a "long", hence "red_left_pad"
> in do_slab_slub()
> > was not initialized properly. This "red_left_pad" issue resulted in
> reporting free objects
> > as "[ALLOCATED]", and in reporting bogus object addresses when using
> "set redzone off".
> >
> Thanks for the fix, LGTM, so ack.
>
>
Applied:
https://github.com/crash-utility/crash/commit/f20a94016148dce397cded5b4ac02c5e33646c99

Thanks
Lianbo


> Thanks,
> Tao Liu
>
> > Signed-off-by: Georges Aureau <georges.aur...@hpe.com>
> > --
> > diff --git a/memory.c b/memory.c
> > index a74ebaf..967a9cf 100644
> > --- a/memory.c
> > +++ b/memory.c
> > @@ -19637,7 +19637,8 @@ do_slab_slub(struct meminfo *si, int verbose)
> >         int i, free_objects, cpu_slab, is_free, node;
> >         ulong p, q;
> >  #define SLAB_RED_ZONE 0x00000400UL
> > -       ulong flags, red_left_pad;
> > +       ulong flags;
> > +       uint red_left_pad;
> >
> >         if (!si->slab) {
> >                 if (CRASHDEBUG(1))
> > @@ -19727,7 +19728,7 @@ do_slab_slub(struct meminfo *si, int verbose)
> >         if (VALID_MEMBER(kmem_cache_red_left_pad)) {
> >                 flags = ULONG(si->cache_buf + OFFSET(kmem_cache_flags));
> >                 if (flags & SLAB_RED_ZONE)
> > -                       red_left_pad = ULONG(si->cache_buf +
> OFFSET(kmem_cache_red_left_pad));
> > +                       red_left_pad = UINT(si->cache_buf +
> OFFSET(kmem_cache_red_left_pad));
> >         }
> >
> >         for (p = vaddr; p < vaddr + objects * si->size; p += si->size) {
> > --
>
--
Crash-utility mailing list -- devel@lists.crash-utility.osci.io
To unsubscribe send an email to devel-le...@lists.crash-utility.osci.io
https://${domain_name}/admin/lists/devel.lists.crash-utility.osci.io/
Contribution Guidelines: https://github.com/crash-utility/crash/wiki

Reply via email to