All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	Andrew Lunn <andrew@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Michael Dege <michael.dege@renesas.com>,
	Christian Mardmoeller <christian.mardmoeller@renesas.com>,
	Dennis Ostermann <dennis.ostermann@renesas.com>
Subject: Re: [PATCH 2/5] net: renesas: rswitch: fix leaked pointer on error path
Date: Wed, 4 Dec 2024 19:40:19 -0800	[thread overview]
Message-ID: <20241204194019.43737f84@kernel.org> (raw)
In-Reply-To: <20241202134904.3882317-3-nikita.yoush@cogentembedded.com>

On Mon,  2 Dec 2024 18:49:01 +0500 Nikita Yushchenko wrote:
> If error path is taken while filling descriptor for a frame, skb
> pointer is left in the entry. Later, on the ring entry reuse, the
> same entry could be used as a part of a multi-descriptor frame,
> and skb for that new frame could be stored in a different entry.
> 
> Then, the stale pointer will reach the completion routine, and passed
> to the release operation.
> 
> Fix that by clearing the saved skb pointer at the error path.

Why not move the assignment down, then? After we have successfully
mapped all entries?

Coincidentally rswitch_ext_desc_set() calls
rswitch_ext_desc_set_info1() for each desc, potentially timestamping
the same frame multiple times? Isn't that an issue?

I agree with Jake that patches 4 and 5 don't seem like obvious fixes,
would be great if you could post them as separate series, they need to
go to a different tree.
-- 
pw-bot: cr

  parent reply	other threads:[~2024-12-05  3:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-02 13:48 [PATCH 0/5] net: renesas: rswitch: several fixes Nikita Yushchenko
2024-12-02 13:49 ` [PATCH 1/5] net: renesas: rswitch: fix possible early skb release Nikita Yushchenko
2024-12-04  0:22   ` Jacob Keller
2024-12-02 13:49 ` [PATCH 2/5] net: renesas: rswitch: fix leaked pointer on error path Nikita Yushchenko
2024-12-04  0:23   ` Jacob Keller
2024-12-05  3:40   ` Jakub Kicinski [this message]
2024-12-05  3:46     ` Nikita Yushchenko
2024-12-06  0:47       ` Jakub Kicinski
2024-12-06 18:17     ` Nikita Yushchenko
2024-12-02 13:49 ` [PATCH 3/5] net: renesas: rswitch: avoid use-after-put for a device tree node Nikita Yushchenko
2024-12-04  0:24   ` Jacob Keller
2024-12-02 13:49 ` [PATCH 4/5] net: renesas: rswitch: do not deinit disabled ports Nikita Yushchenko
2024-12-04  0:27   ` Jacob Keller
2024-12-02 13:49 ` [PATCH 5/5] net: renesas: rswitch: remove speed from gwca structure Nikita Yushchenko
2024-12-04  0:28   ` Jacob Keller
2024-12-04  0:18 ` [PATCH 0/5] net: renesas: rswitch: several fixes Jacob Keller

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=20241204194019.43737f84@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=christian.mardmoeller@renesas.com \
    --cc=davem@davemloft.net \
    --cc=dennis.ostermann@renesas.com \
    --cc=edumazet@google.com \
    --cc=geert+renesas@glider.be \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=michael.dege@renesas.com \
    --cc=netdev@vger.kernel.org \
    --cc=nikita.yoush@cogentembedded.com \
    --cc=pabeni@redhat.com \
    --cc=yoshihiro.shimoda.uh@renesas.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.