public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Kangzheng Gu <xiaoguai0992@gmail.com>,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	horms@kernel.org, kees@kernel.org, thorsten.blum@linux.dev,
	arnd@arndb.de, sjur.brandeland@stericsson.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH v4] net: caif: fix stack out-of-bounds write in cfctrl_link_setup()
Date: Thu, 2 Apr 2026 11:05:21 +0200	[thread overview]
Message-ID: <0f9e9d4e-8083-4297-91d3-10d0f614c87c@redhat.com> (raw)
In-Reply-To: <20260330065342.145549-1-xiaoguai0992@gmail.com>

On 3/30/26 8:53 AM, Kangzheng Gu wrote:
> diff --git a/net/caif/cfctrl.c b/net/caif/cfctrl.c
> index c6cc2bfed65d..373ab1dc67a7 100644
> --- a/net/caif/cfctrl.c
> +++ b/net/caif/cfctrl.c
> @@ -416,8 +416,16 @@ static int cfctrl_link_setup(struct cfctrl *cfctrl, struct cfpkt *pkt, u8 cmdrsp
>  		cp = (u8 *) linkparam.u.rfm.volume;
>  		for (tmp = cfpkt_extr_head_u8(pkt);
>  		     cfpkt_more(pkt) && tmp != '\0';
> -		     tmp = cfpkt_extr_head_u8(pkt))
> +		     tmp = cfpkt_extr_head_u8(pkt)) {
> +			if (cp >= (u8 *)linkparam.u.rfm.volume +
> +			    sizeof(linkparam.u.rfm.volume) - 1) {
> +				pr_warn("Request reject, volume name length exceeds %zu\n",
> +					sizeof(linkparam.u.rfm.volume));

It looks like this printk is remotely triggerable from each incoming
(malformed) packet. It should be rate-limited.

Thanks,

Paolo


  reply	other threads:[~2026-04-02  9:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAKvcANP6ihR9ZJpm73ep6aTPqzcpVhTHsVSgGBd28HwwfdBcxw@mail.gmail.com>
2026-03-29 19:03 ` [PATCH v3] net: caif: fix stack out-of-bounds write in cfctrl_link_setup() Kangzheng Gu
2026-03-30  6:53   ` [PATCH v4] " Kangzheng Gu
2026-04-02  9:05     ` Paolo Abeni [this message]
2026-03-30 14:24   ` [PATCH v3] " kernel test robot
2026-03-30 15:32   ` kernel test robot

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=0f9e9d4e-8083-4297-91d3-10d0f614c87c@redhat.com \
    --to=pabeni@redhat.com \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kees@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sjur.brandeland@stericsson.com \
    --cc=stable@vger.kernel.org \
    --cc=thorsten.blum@linux.dev \
    --cc=xiaoguai0992@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