Loading files/kernel/ksmbd-pipe-transceive.patch +23 −0 Changes for files/kernel/ksmbd-pipe-transceive.patch: 23 added lines, 0 removed lines. Original line number Diff line number Diff line fs/smb/server/transport_tcp.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fs/smb/server/transport_tcp.c b/fs/smb/server/transport_tcp.c index 4968cfc..b2a3d8b 100644 --- a/fs/smb/server/transport_tcp.c +++ b/fs/smb/server/transport_tcp.c @@ -577,6 +577,15 @@ static int ksmbd_netdev_event(struct notifier_block *nb, unsigned long event, struct interface *iface; int ret; + /* + * ksmbd serves the initial namespace only. create_socket() listens in + * the namespace of the task raising the event, so a container bringing + * up its own interface would get a listener on its port 445, and the + * name-only interface lookup would let its interfaces stop ours. + */ + if (!net_eq(dev_net(netdev), &init_net)) + return NOTIFY_DONE; + switch (event) { case NETDEV_UP: if (netif_is_bridge_port(netdev)) No newline at end of file Loading
files/kernel/ksmbd-pipe-transceive.patch +23 −0 Changes for files/kernel/ksmbd-pipe-transceive.patch: 23 added lines, 0 removed lines. Original line number Diff line number Diff line fs/smb/server/transport_tcp.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fs/smb/server/transport_tcp.c b/fs/smb/server/transport_tcp.c index 4968cfc..b2a3d8b 100644 --- a/fs/smb/server/transport_tcp.c +++ b/fs/smb/server/transport_tcp.c @@ -577,6 +577,15 @@ static int ksmbd_netdev_event(struct notifier_block *nb, unsigned long event, struct interface *iface; int ret; + /* + * ksmbd serves the initial namespace only. create_socket() listens in + * the namespace of the task raising the event, so a container bringing + * up its own interface would get a listener on its port 445, and the + * name-only interface lookup would let its interfaces stop ours. + */ + if (!net_eq(dev_net(netdev), &init_net)) + return NOTIFY_DONE; + switch (event) { case NETDEV_UP: if (netif_is_bridge_port(netdev)) No newline at end of file