[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3f624e5b-567d-70f9-322f-e721b2df508b@csgroup.eu>
Date: Tue, 16 Mar 2021 16:40:56 +0100
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: Segher Boessenkool <segher@...nel.crashing.org>
Cc: Alexander Potapenko <glider@...gle.com>,
Marco Elver <elver@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Dmitriy Vyukov <dvyukov@...gle.com>,
Andrey Konovalov <andreyknvl@...gle.com>,
Jann Horn <jannh@...gle.com>,
LKML <linux-kernel@...r.kernel.org>,
Linux Memory Management List <linux-mm@...ck.org>,
kasan-dev <kasan-dev@...glegroups.com>
Subject: Re: [PATCH mm] kfence: fix printk format for ptrdiff_t
Le 16/03/2021 à 16:33, Segher Boessenkool a écrit :
> On Tue, Mar 16, 2021 at 09:32:32AM +0100, Christophe Leroy wrote:
>> +segher
>
> I cannot see through the wood of #defines here, sorry.
>
>> Still a problem.
>>
>> I don't understand, gcc bug ?
>
> Rule #1: If you do not understand what is happening, it is not a
> compiler bug. I'm not saying that it isn't, just that it is much more
> likely something else.
>
>> The offending argument is 'const ptrdiff_t object_index'
>>
>> We have:
>>
>> arch/powerpc/include/uapi/asm/posix_types.h:typedef long
>> __kernel_ptrdiff_t;
>
> So this is a 64-bit build.
No it's 32 bits. The code in posix-types.h is
#ifdef __powerpc64__
...
#else
...
typedef long __kernel_ptrdiff_t;
>
>> include/linux/types.h:typedef __kernel_ptrdiff_t ptrdiff_t;
>>
>> And get:
>>
>> CC mm/kfence/report.o
>> In file included from ./include/linux/printk.h:7,
>> from ./include/linux/kernel.h:16,
>> from mm/kfence/report.c:10:
>> mm/kfence/report.c: In function 'kfence_report_error':
>> ./include/linux/kern_levels.h:5:18: warning: format '%td' expects argument
>> of type 'ptrdiff_t', but argument 6 has type 'long int' [-Wformat=]
>
> This is declared as
> const ptrdiff_t object_index = meta ? meta - kfence_metadata : -1;
> so maybe something with that goes wrong? What happens if you delete the
> (useless) "const" here?
No change.
Christophe
Powered by blists - more mailing lists