Netbird wt0 network interface causes samba core dump when only one client is active in the mesh #241

Closed
opened 2025-11-20 05:08:28 -05:00 by saavagebueno · 1 comment
Owner

Originally created by @gene1wood on GitHub (Nov 29, 2022).

When a Netbird client is running but has no online peers in the network, the wt0 network interface is somehow different from a normal interface. As a result, when samba (smbd) launches, if it's configured to use the wt0 interface, it core dumps and crashes.

Steps to reproduce

  1. Create two netbird clients (one running Linux) and join them to your netbird account so they're within the same mesh
  2. Ensure both clients are Online on the netbird mesh
  3. Install samba on the Linux client
  4. Configure /etc/sambda/smb.conf with the interfaces = wt0 setting and the bind interfaces only = yes setting, telling it to bind to the wt0 interface
  5. Start samba and you'll see that it starts just fine
  6. Stop samba
  7. Power off the other client, so that the only client in the netbird mesh is the Linux client with samba installed
  8. Start samba

Expected results

Samba should start, bind to wt0 and just have no peers to pass traffic to since it's the only client on the network.

Actual results

Samba crashes and produces a core dump.

If you have any trouble reproducing this let me know and I can gather more details about my environment.

Originally created by @gene1wood on GitHub (Nov 29, 2022). When a Netbird client is running but has no online peers in the network, the `wt0` network interface is somehow different from a normal interface. As a result, when samba (smbd) launches, if it's configured to use the `wt0` interface, it core dumps and crashes. # Steps to reproduce 1. Create two netbird clients (one running Linux) and join them to your netbird account so they're within the same mesh 2. Ensure both clients are `Online` on the netbird mesh 3. Install samba on the Linux client 4. Configure `/etc/sambda/smb.conf` with the `interfaces = wt0` setting and the `bind interfaces only = yes` setting, telling it to bind to the `wt0` interface 5. Start samba and you'll see that it starts just fine 6. Stop samba 7. Power off the other client, so that the only client in the netbird mesh is the Linux client with samba installed 8. Start samba # Expected results Samba should start, bind to `wt0` and just have no peers to pass traffic to since it's the only client on the network. # Actual results Samba crashes and produces a core dump. If you have any trouble reproducing this let me know and I can gather more details about my environment.
Author
Owner

@mlsmaycon commented on GitHub (Nov 29, 2022):

Hello @gene1wood, thanks for reporting the issue in such of detailed manner. I was able to reproduce the issue.

Looking for similar cases, I saw reports of core dumps related to Samba and Wireguard interfaces.

Turns out that the issue is mainly due to the Wireguard interface not supporting broadcast, which, combined with not setting the wt0 address in the interfaces option and then configuring bind interfaces only = yes makes smbd exit with a core dump.

On Ubuntu version of smb.conf, we can see a description near this option that mentions the issue handling non-broadcast interfaces:

# Only bind to the named interfaces and/or networks; you must use the
# 'interfaces' option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself.  However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.

Testing here, it worked fine when I configured the interface address like interfaces 100.64.0.135/16 wt0 or when I disabled bind interfaces only

@mlsmaycon commented on GitHub (Nov 29, 2022): Hello @gene1wood, thanks for reporting the issue in such of detailed manner. I was able to reproduce the issue. Looking for similar cases, I saw reports of core dumps related to Samba and Wireguard interfaces. Turns out that the issue is mainly due to the Wireguard interface not supporting broadcast, which, combined with not setting the `wt0` address in the `interfaces` option and then configuring `bind interfaces only = yes` makes smbd exit with a core dump. On Ubuntu version of `smb.conf`, we can see a description near this option that mentions the issue handling non-broadcast interfaces: ```shell # Only bind to the named interfaces and/or networks; you must use the # 'interfaces' option above to use this. # It is recommended that you enable this feature if your Samba machine is # not protected by a firewall or is a firewall itself. However, this # option cannot handle dynamic or non-broadcast interfaces correctly. ``` Testing here, it worked fine when I configured the interface address like `interfaces 100.64.0.135/16 wt0` or when I disabled `bind interfaces only`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#241