linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Konovalov <andreyknvl@google.com>
To: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Alexander Potapenko <glider@google.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	kasan-dev <kasan-dev@googlegroups.com>,
	Linux Memory Management List <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 6/9] kasan: improve slab object description
Date: Tue, 14 Mar 2017 18:15:40 +0100	[thread overview]
Message-ID: <CAAeHK+yMCqcLW1UbJ+iEG5628wO6j=d9a7cRdPTbZTBoK-CfbQ@mail.gmail.com> (raw)
In-Reply-To: <69679f30-e502-d2cf-8dee-4ee88f64f887@virtuozzo.com>

On Thu, Mar 9, 2017 at 1:56 PM, Andrey Ryabinin <aryabinin@virtuozzo.com> wrote:
> On 03/06/2017 08:16 PM, Andrey Konovalov wrote:
>
>>>
>>> What about
>>>
>>> Object at ffff880068388540 belongs to cache kmalloc-128 of size 128
>>> Accessed address is 123 bytes inside of [ffff880068388540, ffff8800683885c0)
>>>
>>> ?
>>
>> Another alternative:
>>
>> Accessed address is 123 bytes inside of [ffff880068388540, ffff8800683885c0)
>> Object belongs to cache kmalloc-128 of size 128
>>
>
> Is it something wrong with just printing offset at the end as I suggested earlier?
> It's more compact and also more clear IMO.

This is what you suggested:

Object at ffff880068388540, in cache kmalloc-128 size: 128 accessed at
offset 123

After minor reworking of punctuation, etc, we get:

Object at ffff880068388540, in cache kmalloc-128 of size 128, accessed
at offset 123

It's good, but I still don't like two things:

1. The line is quite long. Over 84 characters in this example, but
might be longer for different cache names. The solution would be to
split it into two lines.

2. The access might be within the object (for example use-after-free),
or outside the object (slab-out-of-bounds). In this case just saying
"accessed at offset X" might be confusing, since the offset might be
from the start of the object, or might be from the end. The solution
would be to specifically describe this.

Out of all options above this one I like the most:

>> Accessed address is 123 bytes inside of [ffff880068388540, ffff8800683885c0)
>> Object belongs to cache kmalloc-128 of size 128

as:

1. It specifies whether the offset is inside or outside the object.
2. The lines are not too long (the first one is 76 chars).
3. Accounts for larger cache names (the second line has some spare space).
4. Shows exact addresses of start and end of the object (it's possible
to calculate the end address using the start and the size, but it's
nicer to have it already calculated and shown).

Thanks!

>
> --
> You received this message because you are subscribed to the Google Groups "kasan-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to kasan-dev+unsubscribe@googlegroups.com.
> To post to this group, send email to kasan-dev@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/kasan-dev/69679f30-e502-d2cf-8dee-4ee88f64f887%40virtuozzo.com.
> For more options, visit https://groups.google.com/d/optout.

--
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>

  reply	other threads:[~2017-03-14 17:15 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-02 13:48 [PATCH v2 0/9] kasan: improve error reports Andrey Konovalov
2017-03-02 13:48 ` [PATCH v2 1/9] kasan: introduce helper functions for determining bug type Andrey Konovalov
2017-03-02 17:19   ` Alexander Potapenko
2017-03-03 13:15   ` Andrey Ryabinin
2017-03-02 13:48 ` [PATCH v2 2/9] kasan: unify report headers Andrey Konovalov
2017-03-02 13:48 ` [PATCH v2 3/9] kasan: change allocation and freeing stack traces headers Andrey Konovalov
2017-03-02 13:48 ` [PATCH v2 4/9] kasan: simplify address description logic Andrey Konovalov
2017-03-03 13:37   ` Andrey Ryabinin
2017-03-02 13:48 ` [PATCH v2 5/9] kasan: change report header Andrey Konovalov
2017-03-03 13:21   ` Andrey Ryabinin
2017-03-03 14:18     ` Andrey Konovalov
2017-03-03 14:18       ` Andrey Konovalov
2017-03-02 13:48 ` [PATCH v2 6/9] kasan: improve slab object description Andrey Konovalov
2017-03-03 13:31   ` Andrey Ryabinin
2017-03-03 13:52     ` Alexander Potapenko
2017-03-03 14:39       ` Andrey Ryabinin
2017-03-06 13:45         ` Andrey Konovalov
2017-03-06 16:12           ` Andrey Ryabinin
2017-03-06 17:05             ` Andrey Konovalov
2017-03-06 17:16               ` Andrey Konovalov
2017-03-09 12:56                 ` Andrey Ryabinin
2017-03-14 17:15                   ` Andrey Konovalov [this message]
2017-03-20 15:39                     ` Andrey Ryabinin
2017-03-24 19:31                       ` Andrey Konovalov
2017-03-02 13:48 ` [PATCH v2 7/9] kasan: print page description after stacks Andrey Konovalov
2017-03-02 13:48 ` [PATCH v2 8/9] kasan: improve double-free report format Andrey Konovalov
2017-03-02 13:48 ` [PATCH v2 9/9] kasan: separate report parts by empty lines Andrey Konovalov
2017-03-02 13:57 ` [PATCH v2 0/9] kasan: improve error reports Dmitry Vyukov

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='CAAeHK+yMCqcLW1UbJ+iEG5628wO6j=d9a7cRdPTbZTBoK-CfbQ@mail.gmail.com' \
    --to=andreyknvl@google.com \
    --cc=aryabinin@virtuozzo.com \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=kasan-dev@googlegroups.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).