From: David Howells <dhowells@redhat.com>
To: Tomas Bortoli <tomasbortoli@gmail.com>
Cc: dhowells@redhat.com, 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, 03 Aug 2018 14:49:30 +0100 [thread overview]
Message-ID: <17157.1533304170@warthog.procyon.org.uk> (raw)
In-Reply-To: <20180722110519.23917-1-tomasbortoli@gmail.com>
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
next prev parent reply other threads:[~2018-08-03 13:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-22 11:05 Tomas Bortoli
2018-08-03 13:49 ` David Howells [this message]
2018-08-03 17:26 ` Tomas Bortoli
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=17157.1533304170@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=linux-cachefs@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=syzkaller@googlegroups.com \
--cc=tomasbortoli@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome