[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <82f296f8-9538-4c89-952f-ff8768c5a0b7@quicinc.com>
Date: Mon, 21 Oct 2024 21:27:55 -0700
From: Chris Lew <quic_clew@...cinc.com>
To: Denis Kenzior <denkenz@...il.com>, <netdev@...r.kernel.org>
CC: Marcel Holtmann <marcel@...tmann.org>, Andy Gross <agross@...nel.org>,
Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
"David S. Miller"
<davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski
<kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, <linux-arm-msm@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH v1 01/10] net: qrtr: ns: validate msglen before
ctrl_pkt use
On 10/18/2024 11:18 AM, Denis Kenzior wrote:
> The qrtr_ctrl_pkt structure is currently accessed without checking
> if the received payload is large enough to hold the structure's fields.
> Add a check to ensure the payload length is sufficient.
>
> Signed-off-by: Denis Kenzior <denkenz@...il.com>
> Reviewed-by: Marcel Holtmann <marcel@...tmann.org>
> Reviewed-by: Andy Gross <agross@...nel.org>
> ---
> net/qrtr/ns.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/net/qrtr/ns.c b/net/qrtr/ns.c
> index 3de9350cbf30..6158e08c0252 100644
> --- a/net/qrtr/ns.c
> +++ b/net/qrtr/ns.c
> @@ -619,6 +619,9 @@ static void qrtr_ns_worker(struct work_struct *work)
> break;
> }
>
> + if ((size_t)msglen < sizeof(pkt))
sizeof(*pkt)?
> + break;
> +
> pkt = recv_buf;
> cmd = le32_to_cpu(pkt->cmd);
> if (cmd < ARRAY_SIZE(qrtr_ctrl_pkt_strings) &&
Powered by blists - more mailing lists