[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <235fd31a-b20a-58e1-1cb9-0b0e02fce415@gmail.com>
Date: Fri, 3 Aug 2018 19:26:07 +0200
From: Tomas Bortoli <tomasbortoli@...il.com>
To: David Howells <dhowells@...hat.com>
Cc: linux-cachefs@...hat.com, linux-kernel@...r.kernel.org,
syzkaller@...glegroups.com
Subject: Re: [PATCH] fscache: fscache_set_key() - align alloc and usage
On 08/03/2018 03:49 PM, David Howells wrote:
> Tomas Bortoli <tomasbortoli@...il.com> wrote:
>
>> The fscache_set_key() function allocates the buf pointer if index_key_len >
>> sizeof(cookie->inline_key). In such cases the allocated space might not be
>> aligned with the pointer type. This may result in an out-of-bound in the
>> for-loop later in the same function, as the counter is rounded up.
>
> Yeah, it's good idea anyway since I should tell the allocator everything that
> I expect to use - though kmalloc() will effectively rounds up the size to a
> multiple of 8 anyway (ie. the smallest allocation granule is 8 bytes).
>
> David
>
Yeah I forgot that :) at least KASAN won't complain anymore.
Tomas
Powered by blists - more mailing lists