]> git.ipfire.org Git - thirdparty/linux.git/commit
ovpn: ensure socket is owned by ovpn before deref sk_user_data
authorAntonio Quartulli <antonio@openvpn.net>
Tue, 28 Jul 2026 11:48:50 +0000 (13:48 +0200)
committerAntonio Quartulli <antonio@openvpn.net>
Thu, 30 Jul 2026 09:28:30 +0000 (11:28 +0200)
commit59aed1eb60d70678a53acccb0cb337a26ce6680e
tree643da6f17a01ffc4ea158c933faf715f960bb1db
parentcc12f7240c8c4dee557749d33237542613992f14
ovpn: ensure socket is owned by ovpn before deref sk_user_data

Some subsystems, like BPF SOCKMAP, set sk_user_data without
actually setting the encap_type.

For this reason, we must make sure that the type is the
one ovpn expects before dereferencing sk_user_data.

Failing to do so may lead to out-of-bounds reads.

Fixes: f6226ae7a0cd ("ovpn: introduce the ovpn_socket object")
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
drivers/net/ovpn/socket.c