can: raw: raw_setsockopt: limit number of can_filter that can be set
authorMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 5 Dec 2016 10:44:23 +0000 (11:44 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 20 Jun 2017 06:03:01 +0000 (08:03 +0200)
commitcf7969002086e294d8b1b5377b00d1a8de98a3ab
tree3d47e86a2c47800bf8dcaa6122a933f244d95265
parent1918581a164b0e44ff403e7d7db073ef93fab1d2
can: raw: raw_setsockopt: limit number of can_filter that can be set

commit 332b05ca7a438f857c61a3c21a88489a21532364 upstream.

This patch adds a check to limit the number of can_filters that can be
set via setsockopt on CAN_RAW sockets. Otherwise allocations > MAX_ORDER
are not prevented resulting in a warning.

Reference: https://lkml.org/lkml/2016/12/2/230

Reported-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Willy Tarreau <w@1wt.eu>
include/uapi/linux/can.h
net/can/raw.c