All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alvin Šipraga" <ALSI@bang-olufsen.dk>
To: Vladimir Oltean <vladimir.oltean@nxp.com>,
	Saravana Kannan <saravanak@google.com>
Cc: Vladimir Oltean <olteanv@gmail.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Jakub Kicinski <kuba@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Frank Rowand <frowand.list@gmail.com>,
	Rob Herring <robh+dt@kernel.org>
Subject: Re: [PATCH net] net: dsa: sja1105: fix use-after-free after calling of_find_compatible_node, or worse
Date: Thu, 19 Aug 2021 13:46:56 +0000	[thread overview]
Message-ID: <e36c7293-b5c4-f1b3-d224-4363d4b1caf2@bang-olufsen.dk> (raw)
In-Reply-To: <20210819112246.k2om3r7der3xnxq6@skbuf>

Hi Vladimir,

On 8/19/21 1:22 PM, Vladimir Oltean wrote:
> 
> Sorry for the delay, I wanted to reconfirm what I said (hint, I was wrong).

Thanks for the clarification. It also lines up with Saravana's analysis 
for my case.

> 
> In my case, whatever I do, I cannot get the driver core enforce a device
> link between the ethernet-switch and the PHY.
> 
> So I cannot actually see the same issue. What I was seeing was in fact
> stupid testing on my part (it was working with the PHY driver as
> built-in, it was working, then I made it a module, it broke, I forgot to
> switch it back to module, then I thought it's broken while the PHY is
> built-in).

Do you mean to say that you are hitting the "case (1)" that Saravana 
described? See below:

On 8/19/21 5:28 AM, Saravana Kannan wrote:
> The main problem is that the parent device switch seems to be assuming
> it's child/grandchild devices (mdiobus/PHYs) will have probed
> successfully as soon as they are added. This assumption is not true
> and can be broken for multiple reasons such as:
> 
> 1. The driver for the child devices (PHYs in this case) could be
> loaded as a module after the parent (switch) is probed. So when the
> devices are added, the PHYs would not be probed.
> 2. The child devices could defer probe because one of their suppliers
> isn't ready yet. Either because of fw_devlink=on or the framework
> itself returning -EPROBE_DEFER.
> 3. The child devices could be getting probed asynchronously. So the
> device_add() would kick off a thread to probe the child devices in a
> separate thread.

I would think that - in general - it should not matter if the PHY driver 
is built as a module.

Kind regards,
Alvin

  reply	other threads:[~2021-08-19 13:47 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-17 14:52 [PATCH net] net: dsa: sja1105: fix use-after-free after calling of_find_compatible_node, or worse Vladimir Oltean
2021-08-17 21:25 ` Alvin Šipraga
2021-08-17 22:05   ` Andrew Lunn
2021-08-17 22:19     ` Alvin Šipraga
2021-08-17 22:31   ` Vladimir Oltean
2021-08-17 22:40     ` Vladimir Oltean
2021-08-17 23:01     ` Alvin Šipraga
2021-08-18  2:46     ` Saravana Kannan
2021-08-18 10:18       ` Alvin Šipraga
2021-08-19  3:28         ` Saravana Kannan
2021-08-19 11:22           ` Vladimir Oltean
2021-08-19 13:46             ` Alvin Šipraga [this message]
2021-08-20  0:50             ` Saravana Kannan
2021-08-19 13:35           ` Andrew Lunn
2021-08-19 23:52             ` Saravana Kannan
2021-08-20  0:37               ` Vladimir Oltean
2021-08-20  1:25                 ` Saravana Kannan
2021-08-20 13:01               ` Andrew Lunn
2021-08-19 13:42           ` Alvin Šipraga
2021-08-20  1:08             ` Saravana Kannan
2021-08-20 16:52               ` Saravana Kannan
2021-08-20 17:54                 ` Andrew Lunn
2021-08-20 18:10                   ` Saravana Kannan
2021-08-22 14:19                 ` Alvin Šipraga
2021-08-23 18:50                   ` Saravana Kannan
2021-08-23 20:43                     ` Andrew Lunn
2021-08-23 21:23                       ` Saravana Kannan
2021-08-25 13:40                     ` Alvin Šipraga
2021-08-26  5:33                       ` Saravana Kannan
2021-08-26  7:49                         ` Saravana Kannan
2021-08-26 11:09                         ` Alvin Šipraga
2021-08-18  9:30 ` patchwork-bot+netdevbpf

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=e36c7293-b5c4-f1b3-d224-4363d4b1caf2@bang-olufsen.dk \
    --to=alsi@bang-olufsen.dk \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=frowand.list@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=saravanak@google.com \
    --cc=vivien.didelot@gmail.com \
    --cc=vladimir.oltean@nxp.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.