From: Andre Werner <andre.werner@systec-electronic.com>
To: andrew@lunn.ch, hkallweit1@gmail.com, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com
Cc: linux@armlinux.org.uk, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
Andre Werner <andre.werner@systec-electronic.com>
Subject: [net-next v5 0/2] Prevent nullptr exceptions in ISR
Date: Mon, 29 Jan 2024 14:55:03 +0100 [thread overview]
Message-ID: <20240129135734.18975-1-andre.werner@systec-electronic.com> (raw)
In case phydev->irq is modified unconditionally to a valid IRQ, handling
the IRQ may lead to a nullptr exception if no interrupt handler is
registered to the phy driver. phy_interrupt calls a
phy_device->handle_interrupt unconditionally. And interrupts are enabled
in phy_connect_direct if phydev->irq is not equal to PHY_POLL or
PHY_MAC_INTERRUPT, so it does not check for a phy driver providing an ISR.
Adding an additonal check for a valid interrupt handler in phy_attach_direct
function, and falling back to polling mode if not, should prevent for
such nullptr exceptions.
Moreover, the ADIN1100 phy driver is extended with an interrupt handler
for changes in the link status.
Andre Werner (2):
net: phy: phy_device: Prevent nullptr exceptions on ISR
net: phy: adin1100: Add interrupt support for link change
drivers/net/phy/adin1100.c | 55 ++++++++++++++++++++++++++++++++++++
drivers/net/phy/phy_device.c | 13 +++++----
2 files changed, 63 insertions(+), 5 deletions(-)
--
2.43.0
next reply other threads:[~2024-01-29 13:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-29 13:55 Andre Werner [this message]
2024-01-29 13:55 ` [net-next v5 1/2] net: phy: phy_device: Prevent nullptr exceptions on ISR Andre Werner
2024-01-29 14:29 ` Andrew Lunn
2024-01-30 6:54 ` Andre Werner
2024-01-29 13:55 ` [net-next v5 2/2] net: phy: adin1100: Add interrupt support for link change Andre Werner
2024-02-01 0:30 ` [net-next v5 0/2] Prevent nullptr exceptions in ISR 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=20240129135734.18975-1-andre.werner@systec-electronic.com \
--to=andre.werner@systec-electronic.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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