All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomas Bortoli <tomasbortoli@gmail.com>
To: David Howells <dhowells@redhat.com>
Cc: linux-cachefs@redhat.com, linux-kernel@vger.kernel.org,
	syzkaller@googlegroups.com
Subject: Re: [PATCH] fscache: fscache_set_key() - align alloc and usage
Date: Fri, 3 Aug 2018 19:26:07 +0200	[thread overview]
Message-ID: <235fd31a-b20a-58e1-1cb9-0b0e02fce415@gmail.com> (raw)
In-Reply-To: <17157.1533304170@warthog.procyon.org.uk>

On 08/03/2018 03:49 PM, David Howells wrote:
> Tomas Bortoli <tomasbortoli@gmail.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

      reply	other threads:[~2018-08-03 17:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-22 11:05 [PATCH] fscache: fscache_set_key() - align alloc and usage Tomas Bortoli
2018-08-03 13:49 ` David Howells
2018-08-03 17:26   ` Tomas Bortoli [this message]

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=235fd31a-b20a-58e1-1cb9-0b0e02fce415@gmail.com \
    --to=tomasbortoli@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=linux-cachefs@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzkaller@googlegroups.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.