dlm: use kernel_connect() and kernel_bind()
authorJordan Rife <jrife@google.com>
Mon, 6 Nov 2023 21:24:38 +0000 (15:24 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Feb 2024 00:18:54 +0000 (16:18 -0800)
commitc018ab3e31b16ff97b9b95b69904104c9fcca95b
treee4284830377de698e5d1c31814bbc12ccaf81ace
parent820831de220c89cd618cf2529c3d31df9635f708
dlm: use kernel_connect() and kernel_bind()

commit e9cdebbe23f1aa9a1caea169862f479ab3fa2773 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 protect callers
in such cases.

Link: https://lore.kernel.org/netdev/9944248dba1bce861375fcce9de663934d933ba9.camel@redhat.com/
Fixes: d74bad4e74ee ("bpf: Hooks for sys_connect")
Fixes: 4fbac77d2d09 ("bpf: Hooks for sys_bind")
Cc: stable@vger.kernel.org
Signed-off-by: Jordan Rife <jrife@google.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/dlm/lowcomms.c