From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754282AbdCFRFh (ORCPT ); Mon, 6 Mar 2017 12:05:37 -0500 Received: from mail-wm0-f41.google.com ([74.125.82.41]:36925 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752726AbdCFRFb (ORCPT ); Mon, 6 Mar 2017 12:05:31 -0500 MIME-Version: 1.0 In-Reply-To: <576aeb81-9408-13fa-041d-a6bd1e2cf895@virtuozzo.com> References: <20170302134851.101218-1-andreyknvl@google.com> <20170302134851.101218-7-andreyknvl@google.com> <2bbe7bdc-8842-8ec0-4b5a-6a8dce39216d@virtuozzo.com> <576aeb81-9408-13fa-041d-a6bd1e2cf895@virtuozzo.com> From: Andrey Konovalov Date: Mon, 6 Mar 2017 18:05:28 +0100 Message-ID: Subject: Re: [PATCH v2 6/9] kasan: improve slab object description To: Andrey Ryabinin Cc: Alexander Potapenko , Dmitry Vyukov , kasan-dev , Linux Memory Management List , LKML Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 6, 2017 at 5:12 PM, Andrey Ryabinin wrote: > On 03/06/2017 04:45 PM, Andrey Konovalov wrote: >> On Fri, Mar 3, 2017 at 3:39 PM, Andrey Ryabinin wrote: >>> >>> >>> On 03/03/2017 04:52 PM, Alexander Potapenko wrote: >>>> On Fri, Mar 3, 2017 at 2:31 PM, Andrey Ryabinin wrote: >>>>> On 03/02/2017 04:48 PM, Andrey Konovalov wrote: >>>>>> Changes slab object description from: >>>>>> >>>>>> Object at ffff880068388540, in cache kmalloc-128 size: 128 >>>>>> >>>>>> to: >>>>>> >>>>>> The buggy address belongs to the object at ffff880068388540 >>>>>> which belongs to the cache kmalloc-128 of size 128 >>>>>> The buggy address is located 123 bytes inside of >>>>>> 128-byte region [ffff880068388540, ffff8800683885c0) >>>>>> >>>>>> Makes it more explanatory and adds information about relative offset >>>>>> of the accessed address to the start of the object. >>>>>> >>>>> >>>>> I don't think that this is an improvement. You replaced one simple line with a huge >>>>> and hard to parse text without giving any new/useful information. >>>>> Except maybe offset, it useful sometimes, so wouldn't mind adding it to description. >>>> Agreed. >>>> How about: >>>> =========== >>>> Access 123 bytes inside of 128-byte region [ffff880068388540, ffff8800683885c0) >>>> Object at ffff880068388540 belongs to the cache kmalloc-128 >>>> =========== >>>> ? >>>> >>> >>> I would just add the offset in the end: >>> Object at ffff880068388540, in cache kmalloc-128 size: 128 accessed at offset y >> >> Access can be inside or outside the object, so it's better to >> specifically say that. >> > > That what access offset and object's size tells us. > > >> I think we can do (basically what Alexander suggested): >> >> Object at ffff880068388540 belongs to the cache kmalloc-128 of size 128 >> Access 123 bytes inside of 128-byte region [ffff880068388540, ffff8800683885c0) > > This is just wrong and therefore very confusing. The message says that we access 123 bytes, > while in fact we access x-bytes at offset 123. IOW 123 sounds like access size here not the offset. What about Object at ffff880068388540 belongs to cache kmalloc-128 of size 128 Accessed address is 123 bytes inside of [ffff880068388540, ffff8800683885c0) ? > > >> What do you think? >> > > Not better.