mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: Ruoyu Wang <ruoyuw560@gmail.com>
Cc: fenlason@redhat.com, stefanr@s5r6.in-berlin.de,
	linux1394-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] firewire: net: Fix fragmented datagram reassembly
Date: Mon, 13 Jul 2026 20:21:04 +0900	[thread overview]
Message-ID: <20260713112104.GA123079@sakamocchi.jp> (raw)
In-Reply-To: <20260707150454.2265951-1-ruoyuw560@gmail.com>

Hi,

On Tue, Jul 07, 2026 at 11:04:54PM +0800, Ruoyu Wang wrote:
> fwnet_frag_new() keeps a sorted list of received fragments for a partial
> datagram. When a new fragment is adjacent to an existing fragment, the
> code checks whether the new fragment also closes the gap to the next or
> previous list entry.
> 
> Those neighbor lookups currently assume that the current fragment always
> has a real next or previous fragment. At a list edge, the next or
> previous entry is the list head, not a struct fwnet_fragment_info.
> 
> The gap checks also compare against the old edge of the current fragment
> instead of the edge after adding the new fragment. As a result, a
> fragment that bridges two existing ranges may leave two adjacent ranges
> unmerged, so fwnet_pd_is_complete() can miss a complete datagram.
> 
> Check for the list head before looking up the neighboring fragment, and
> compare the neighbor against the new fragment's far edge when deciding
> whether to merge all three ranges.
> 
> This issue was found by a static analysis checker and confirmed by
> manual source review.
> 
> Fixes: c76acec6d551 ("firewire: add IPv4 support")
> Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>
> ---
>  drivers/firewire/net.c | 39 +++++++++++++++++++++------------------
>  1 file changed, 21 insertions(+), 18 deletions(-)

Applied to for-linus branch.


Thanks

Takashi Sakamoto

      reply	other threads:[~2026-07-13 11:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-07 15:04 Ruoyu Wang
2026-07-13 11:21 ` Takashi Sakamoto [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=20260713112104.GA123079@sakamocchi.jp \
    --to=o-takashi@sakamocchi.jp \
    --cc=fenlason@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    --cc=ruoyuw560@gmail.com \
    --cc=stefanr@s5r6.in-berlin.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

all inboxes | Powered by JetHome®