From: David Howells <dhowells@redhat.com>
To: Dave Wysochanski <dwysocha@redhat.com>
Cc: dhowells@redhat.com, linux-cachefs@redhat.com,
jlayton@kernel.org, smfrench@gmail.com,
linux-cifs@vger.kernel.org
Subject: Re: [PATCH] cachefiles: Fix KASAN slab-out-of-bounds in cachefiles_set_volume_xattr
Date: Tue, 05 Apr 2022 15:14:10 +0100 [thread overview]
Message-ID: <1788451.1649168050@warthog.procyon.org.uk> (raw)
In-Reply-To: <20220405134649.6579-1-dwysocha@redhat.com>
Dave Wysochanski <dwysocha@redhat.com> wrote:
> @@ -203,7 +203,7 @@ bool cachefiles_set_volume_xattr(struct cachefiles_volume *volume)
> if (!buf)
> return false;
> buf->reserved = cpu_to_be32(0);
> - memcpy(buf->data, p, len);
> + memcpy(buf->data, p, volume->vcookie->coherency_len);
Good catch. However, I think it's probably better to change things a bit
further up, eg.:
- len += sizeof(*buf);
- buf = kmalloc(len, GFP_KERNEL);
+ buf = kmalloc(sizeof(*buf) + len, GFP_KERNEL);
David
next prev parent reply other threads:[~2022-04-05 23:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-05 13:46 [PATCH] cachefiles: Fix KASAN slab-out-of-bounds in cachefiles_set_volume_xattr Dave Wysochanski
2022-04-05 14:14 ` David Howells [this message]
2022-04-05 14:24 ` David Wysochanski
2022-04-05 15:54 ` David Wysochanski
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=1788451.1649168050@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=dwysocha@redhat.com \
--cc=jlayton@kernel.org \
--cc=linux-cachefs@redhat.com \
--cc=linux-cifs@vger.kernel.org \
--cc=smfrench@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 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.