* [PATCH net] vlan: prevent cross-netns MII register writes
@ 2026-11-06 12:46 Hungyu Lin
2026-11-06 12:51 ` netdev-bot+sinfo
0 siblings, 1 reply; 2+ messages in thread
From: Hungyu Lin @ 2026-11-06 12:46 UTC (permalink / raw)
To: davem
Cc: edumazet, kuba, pabeni, horms, n05ec, ylong030, netdev,
linux-kernel, sashiko-bot, dennylin0707, stable
vlan_dev_ioctl() forwards SIOCSMIIREG to the underlying real
device without checking whether the VLAN device and real device
belong to the same network namespace.
A VLAN device can be moved into another network namespace while
its real device remains in the host namespace. This allows a
process with the required privileges in the VLAN device's
namespace to modify PHY registers on the host's real device.
Reject SIOCSMIIREG when the two devices belong to different
network namespaces. Preserve MII reads across namespaces and
allow MII writes when both devices belong to the same namespace.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
---
net/8021q/vlan_dev.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index bca0a3693636..0d0904103302 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -416,9 +416,12 @@ static int vlan_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
ifrr.ifr_ifru = ifr->ifr_ifru;
switch (cmd) {
+ case SIOCSMIIREG:
+ if (!net_eq(dev_net(dev), dev_net(real_dev)))
+ break;
+ fallthrough;
case SIOCGMIIPHY:
case SIOCGMIIREG:
- case SIOCSMIIREG:
err = dev_eth_ioctl(real_dev, &ifrr, cmd);
break;
}
--
2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH net] vlan: prevent cross-netns MII register writes
2026-11-06 12:46 [PATCH net] vlan: prevent cross-netns MII register writes Hungyu Lin
@ 2026-11-06 12:51 ` netdev-bot+sinfo
0 siblings, 0 replies; 2+ messages in thread
From: netdev-bot+sinfo @ 2026-11-06 12:51 UTC (permalink / raw)
To: Hungyu Lin
Cc: davem, edumazet, kuba, pabeni, horms, n05ec, ylong030, netdev,
linux-kernel, sashiko-bot, stable
Hi!
This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:
- How the issue was discovered, e.g. hit in production, hit during
development, syzbot report, manual code inspection, LLM or static
analysis tool scan.
- Whether the issue was actually triggered, or is only theoretical
(e.g. found by code inspection). If it was triggered please include
the symptoms, like the stack trace or error messages.
Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account. If the series needs another revision for
other reasons, please include the information in the commit messages
then.
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-06 12:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-06 12:46 [PATCH net] vlan: prevent cross-netns MII register writes Hungyu Lin
2026-11-06 12:51 ` netdev-bot+sinfo
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®