Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit adb552c3 authored by Marc Kleine-Budde's avatar Marc Kleine-Budde
Browse files

can: raw: raw_bind(): bail out if can_family is not AF_CAN



Until now CAN raw's bind() doesn't check if the can_familiy in the
struct sockaddr_can is set to AF_CAN. This patch adds the missing check.

Acked-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 2ef5e757
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -401,6 +401,8 @@ static int raw_bind(struct socket *sock, struct sockaddr *uaddr, int len)

	if (len < sizeof(*addr))
		return -EINVAL;
	if (addr->can_family != AF_CAN)
		return -EINVAL;

	lock_sock(sk);