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: Fri, 6 Dec 2024 23:17:01 +0500	[thread overview]
Message-ID: <3796604a-0636-41ac-b7e2-13ccd0694d4d@cogentembedded.com> (raw)
In-Reply-To: <20241204194019.43737f84@kernel.org>

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

Just realized that moving assignment below the loop will open a race window. DT field is set inside the 
loop, and once it is set, completion interrupt becomes theoretically possible.

Furthermore, realized that existing code already has a race. Interrupt can happen after DT wield was 
updated but before cur is updated. Then, with the completion code won't check the entry (up to a new 
interrupt, that can theoretically not happen).

Will fix in the updated patches.

Nikita

  parent reply	other threads:[~2024-12-06 18:17 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
2024-12-06  0:47       ` Jakub Kicinski
2024-12-06 18:17     ` Nikita Yushchenko [this message]
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=3796604a-0636-41ac-b7e2-13ccd0694d4d@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®