From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Lucas Stach <l.stach@pengutronix.de>
Cc: linux-input@vger.kernel.org, patchwork-lst@pengutronix.de,
kernel@pengutronix.de
Subject: Re: [PATCH resend 1/3] Input: synaptics-rmi4 - fix video buffer size
Date: Mon, 4 Nov 2019 16:02:33 -0800 [thread overview]
Message-ID: <20191105000233.GQ57214@dtor-ws> (raw)
In-Reply-To: <20191104114454.10500-1-l.stach@pengutronix.de>
On Mon, Nov 04, 2019 at 12:44:52PM +0100, Lucas Stach wrote:
> The video buffer used by the queue is a vb2_v4l2_buffer, not a plain
> vb2_buffer. Using the wrong type causes the allocation of the buffer
> storage to be too small, causing a out of bounds write when
> __init_vb2_v4l2_buffer initializes the buffer.
>
> Fixes: 3a762dbd5347 ("[media] Input: synaptics-rmi4 - add support
> for F54 diagnostics")
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Applied, thank you.
> ---
> drivers/input/rmi4/rmi_f54.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/input/rmi4/rmi_f54.c b/drivers/input/rmi4/rmi_f54.c
> index 710b02595486..4841354af0d7 100644
> --- a/drivers/input/rmi4/rmi_f54.c
> +++ b/drivers/input/rmi4/rmi_f54.c
> @@ -359,7 +359,7 @@ static const struct vb2_ops rmi_f54_queue_ops = {
> static const struct vb2_queue rmi_f54_queue = {
> .type = V4L2_BUF_TYPE_VIDEO_CAPTURE,
> .io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF | VB2_READ,
> - .buf_struct_size = sizeof(struct vb2_buffer),
> + .buf_struct_size = sizeof(struct vb2_v4l2_buffer),
> .ops = &rmi_f54_queue_ops,
> .mem_ops = &vb2_vmalloc_memops,
> .timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC,
> --
> 2.20.1
>
--
Dmitry
prev parent reply other threads:[~2019-11-05 0:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-04 11:44 [PATCH resend 1/3] Input: synaptics-rmi4 - fix video buffer size Lucas Stach
2019-11-04 11:44 ` [PATCH resend 2/3] Input: synaptics-rmi4 - add dummy F54 attention handler Lucas Stach
2019-11-05 0:03 ` Dmitry Torokhov
2019-11-05 11:46 ` Lucas Stach
2019-11-04 11:44 ` [PATCH resend 3/3] Input: synaptics-rmi4 - simplify data read in rmi_f54_work Lucas Stach
2019-11-05 0:02 ` Dmitry Torokhov
2019-11-05 0:02 ` Dmitry Torokhov [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=20191105000233.GQ57214@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=kernel@pengutronix.de \
--cc=l.stach@pengutronix.de \
--cc=linux-input@vger.kernel.org \
--cc=patchwork-lst@pengutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).