]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
smb: use kernel_connect() and kernel_bind()
authorJordan Rife <jrife@google.com>
Wed, 4 Oct 2023 01:13:03 +0000 (20:13 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Oct 2023 20:03:04 +0000 (22:03 +0200)
commitc9969a3d310da58a4be577333bb1933b60af5ddb
tree92db32ee9c2f815845a0ee1e4ae3eeb4b2f79842
parent0779db5863335dfd8deaef882199d269dd6e9abe
smb: use kernel_connect() and kernel_bind()

commit cedc019b9f260facfadd20c6c490e403abf292e3 upstream.

Recent changes to kernel_connect() and kernel_bind() ensure that
callers are insulated from changes to the address parameter made by BPF
SOCK_ADDR hooks. This patch wraps direct calls to ops->connect() and
ops->bind() with kernel_connect() and kernel_bind() to ensure that SMB
mounts do not see their mount address overwritten in such cases.

Link: https://lore.kernel.org/netdev/9944248dba1bce861375fcce9de663934d933ba9.camel@redhat.com/
Cc: <stable@vger.kernel.org> # 6.0+
Signed-off-by: Jordan Rife <jrife@google.com>
Acked-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/smb/client/connect.c