Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

+2
+2
net/can/raw.c
··· 401 401 402 402 if (len < sizeof(*addr)) 403 403 return -EINVAL; 404 + if (addr->can_family != AF_CAN) 405 + return -EINVAL; 404 406 405 407 lock_sock(sk); 406 408