Download raw body.
em(4): detect BMC network reachable
On Fri, Nov 06, 2026 at 09:33:35AM -0600, Theo de Raadt wrote:
> +Traffic to and from the BMC is potentially handled by the controller's
> +management firmware and is not visible to the operating system.
>
> Well I think this does not address the real concern. It means a
> typcally buggy BMC is on this network. It means some catagory of
> packets is stolen. It can also mean the port carries two MAC
> addresses. There are a bunch of problems, and I don't think this
> sentencies conveys it enough.
ok?
Index: sys/dev/pci/if_em.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_em.c,v
diff -u -p -r1.384 if_em.c
--- sys/dev/pci/if_em.c 14 Aug 2026 06:40:24 -0000 1.384
+++ sys/dev/pci/if_em.c 6 Nov 2026 12:23:51 -0000
@@ -619,6 +619,16 @@ em_attach(struct device *parent, struct
printf("%s: PHY reset is blocked due to SOL/IDER session.\n",
DEVNAME(sc));
+ /* Indicate whether the BMC is reachable via this port */
+ if (sc->hw.mac_type == em_i210 || sc->hw.mac_type == em_i350) {
+ uint32_t manc = E1000_READ_REG(&sc->hw, MANC);
+
+ if (ISSET(manc, E1000_MANC_RCV_TCO_EN) &&
+ ISSET(manc, E1000_MANC_EN_BMC2NET))
+ printf("%s: warning - BMC is enabled on this interface\n",
+ DEVNAME(sc));
+ }
+
/* Identify 82544 on PCI-X */
if (sc->hw.bus_type == em_bus_type_pcix &&
sc->hw.mac_type == em_82544)
Index: sys/dev/pci/if_em_hw.h
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_em_hw.h,v
diff -u -p -r1.103 if_em_hw.h
--- sys/dev/pci/if_em_hw.h 14 Aug 2026 07:21:33 -0000 1.103
+++ sys/dev/pci/if_em_hw.h 6 Nov 2026 12:22:13 -0000
@@ -2245,6 +2245,7 @@ struct e1000_adv_tx_context_desc {
#define E1000_MANC_SMB_DATA_IN 0x08000000 /* SMBus Data In */
#define E1000_MANC_SMB_DATA_OUT 0x10000000 /* SMBus Data Out */
#define E1000_MANC_SMB_CLK_OUT 0x20000000 /* SMBus Clock Out */
+#define E1000_MANC_EN_BMC2NET 0x20000000 /* MC <-> network traffic */
#define E1000_MANC_SMB_DATA_OUT_SHIFT 28 /* SMBus Data Out Shift */
#define E1000_MANC_SMB_CLK_OUT_SHIFT 29 /* SMBus Clock Out Shift */
Index: share/man/man4/em.4
===================================================================
RCS file: /cvs/src/share/man/man4/em.4,v
diff -u -p -r1.55 em.4
--- share/man/man4/em.4 8 Sep 2021 20:29:21 -0000 1.55
+++ share/man/man4/em.4 6 Nov 2026 13:42:22 -0000
@@ -193,6 +193,23 @@ Only full-duplex mode is supported at th
.Pp
For more information on configuring this device, see
.Xr ifconfig 8 .
+.Sh DIAGNOSTICS
+.Bl -tag -width Ds
+.It "warning - BMC is enabled on this interface"
+.Pp
+A baseboard management controller (BMC) shares this interface with the host
+and is directly reachable from the connected network.
+BMC firmware is often buggy and has a history of security vulnerabilities,
+so exposing it to an untrusted network is a risk.
+The controller diverts certain categories of received packets to the BMC,
+for example ARP, RMCP, or traffic addressed to the BMC.
+These packets are consumed by the BMC and are not visible to the operating
+system.
+The BMC may also use its own MAC address,
+so the port can appear on the network with two MAC addresses.
+Depending on the system, the BMC's network access may be disabled in the BIOS
+or BMC configuration.
+.El
.Sh SEE ALSO
.Xr arp 4 ,
.Xr gcu 4 ,
em(4): detect BMC network reachable