can: fix handling of unmodifiable configuration options fix
PATCH 1/1 can: fix handling of unmodifiable configuration options fix
With upstream commit bb208f144cf3f59 (can: fix handling of unmodifiable configuration options) a new can_validate() function was introduced.
When invoking 'ip link set can0 type can' without any configuration data can_validate() tries to validate the content without taking into account that there's totally no content. This patch adds a check for missing content.
--- drivers/net/can/dev.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/can/dev.c +3 -0
@@ -798,6 +798,9 @@ static int can_validate(struct nlattr *tb[], struct nlattr *data[])* - control mode with CAN_CTRLMODE_FD set */ +if (!data) +return 0 ; +if (data[IFLA_CAN_CTRLMODE ]) {struct can_ctrlmode *cm =nla_data (data[IFLA_CAN_CTRLMODE ]);
Signature · 1 line
2.8.1
Quoted 9 lines · Oliver Hartkopp
With upstream commit
bb208f144cf3f59(can: fix handling of unmodifiable configuration options) a newcan_validate()function was introduced.When invoking 'ip link set can0 type can' without any configuration data
can_validate()tries to validate the content without taking into account that there's totally no content. This patch adds a check for missing content.Reported-by ajneu <[email protected]>Signed-off-by Oliver Hartkopp <[email protected]>
Applied to can + stable on Cc.
Tnx,
Marc
Signature · 4 lines
Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |