]> git.baikalelectronics.ru Git - kernel.git/commit
can: dev: fix crtlmode_supported check
authorOliver Hartkopp <socketcan@hartkopp.net>
Mon, 5 Jan 2015 17:40:15 +0000 (18:40 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 15 Jan 2015 15:57:59 +0000 (16:57 +0100)
commitaf73b9f965d59c9d365a8232c2583a9e97ecec0c
tree8636f06d98c2e7c907e88ca91d1928ec9ea47279
parent6b21919e00abe0db1632c7cdedf93e415f2b8228
can: dev: fix crtlmode_supported check

When changing flags in the CAN drivers ctrlmode the provided new content has to
be checked whether the bits are allowed to be changed. The bits that are to be
changed are given as a bitfield in cm->mask. Therefore checking against
cm->flags is wrong as the content can hold any kind of values.

The iproute2 tool sets the bits in cm->mask and cm->flags depending on the
detected command line options. To be robust against bogus user space
applications additionally sanitize the provided flags with the provided mask.

Cc: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/dev.c