mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
To: Jakub Kicinski <kuba@kernel.org>
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: Thu, 5 Dec 2024 08:46:15 +0500	[thread overview]
Message-ID: <9b2607ac-a577-49ca-8106-b82b25723439@cogentembedded.com> (raw)
In-Reply-To: <20241204194019.43737f84@kernel.org>

>> 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?

That is a different possible way to fix the same issue.  Either can be used.

> 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?

Somebody familiar with how timestamping works shall comment on this.

> 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.

Ok, will repost.

Shall I use [PATCH net] for all?
Or [PATCH] for fixes and [PATCH net] for improvements?

Nikita

  reply	other threads:[~2024-12-05  3:46 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
2024-12-05  3:46     ` Nikita Yushchenko [this message]
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=9b2607ac-a577-49ca-8106-b82b25723439@cogentembedded.com \
    --to=nikita.yoush@cogentembedded.com \
    --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=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=michael.dege@renesas.com \
    --cc=netdev@vger.kernel.org \
    --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 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®