smbXsrv_client: notify a different node to drop a connection by client guid.
authorStefan Metzmacher <metze@samba.org>
Tue, 30 Aug 2022 18:45:50 +0000 (20:45 +0200)
committerJule Anger <janger@samba.org>
Tue, 6 Sep 2022 10:27:58 +0000 (10:27 +0000)
commit71c94a076bad166098e1c24e45f866abdd6c8f92
tree5827162ae86ef4357d2f98c3658627dede061767
parent095ee4ce189f12e13cb9d70bd99a670623aa08ae
smbXsrv_client: notify a different node to drop a connection by client guid.

If a client disconnected all its interfaces and reconnects when
the come back, it will likely start from any ip address returned
dns, which means it can try to connect to a different ctdb node.
The old node may not have noticed the disconnect and still holds
the client_guid based smbd.

Up unil now the new node returned NT_STATUS_NOT_SUPPORTED to
the SMB2 Negotiate request, as messaging_send_iov[_from]() will
return -1/ENOSYS if a file descriptor os passed to a process on
a different node.

Now we tell the other node to teardown all client connections
belonging to the client-guid.

Note that this is not authenticated, but if an attacker can
capture the client-guid, he can also inject TCP resets anyway,
to get the same effect.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15159

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Sep  2 20:59:15 UTC 2022 on sn-devel-184

(cherry picked from commit 8591d9424371e173b079d5c8a267ea4c2cb266ad)

Autobuild-User(v4-17-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-17-test): Tue Sep  6 10:27:58 UTC 2022 on sn-devel-184
librpc/idl/messaging.idl
selftest/knownfail.d/bug_15159 [deleted file]
source3/librpc/idl/smbXsrv.idl
source3/smbd/smbXsrv_client.c