Skip to contentSkip to conversation

can: dev: fix crtlmode_supported check

PATCH Applied Marc Kleine-Budde 4 participants 5 messages Jan 28, 2015 – Apr 9, 2015 1 message not in the archive CAN network drivers

lore
Share & tools
lore

Marc Kleine-Budde

author maintainer
#1 lore raw
In reply to a message not in the archive
Quoted 11 lines · Oliver Hartkopp

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.

(Backport of upstream commit 9b1087aa5e86448fe6ad40a58964e35f3ba423d5 for Linux 3.2 .. Linux 3.14)

Zefan Li <[email protected]> is taking care of v3.4

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   |
#2 lore raw

Oh yes.

I got the entire thread twice.
I was assuming this to be the groundhog day :-)

See picture.

Regards,
Oliver

Quoted 17 lines · Marc Kleine-Budde
Quoted 11 lines · Oliver Hartkopp

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.

(Backport of upstream commit 9b1087aa5e86448fe6ad40a58964e35f3ba423d5 for Linux 3.2 .. Linux 3.14)

Zefan Li <[email protected]> is taking care of v3.4

Marc

#3 lore raw
In reply to Marc Kleine-Budde

Hello all,

just in the case you are interested to pick these patches up for 3.2 and 3.4 stable:

The backported patch for Linux 3.2 ... 3.14 has been queued by GregKH for the 3.10 kernel here:

http://git.kernel.org/cgit/linux/kernel/git/stable/stable-queue.git/tree/queue-3.10/can-dev-fix-crtlmode_supported-check.patch?id=332373aa9a50a1c18027be7352d6138fa74263d0

Best regards,
Oliver

Quoted 17 lines · Marc Kleine-Budde
Quoted 11 lines · Oliver Hartkopp

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.

(Backport of upstream commit 9b1087aa5e86448fe6ad40a58964e35f3ba423d5 for Linux 3.2 .. Linux 3.14)

Zefan Li <[email protected]> is taking care of v3.4

Marc

#4 lore raw
Quoted 9 lines · Oliver Hartkopp

Hello all,

just in the case you are interested to pick these patches up for 3.2 and 3.4 stable:

The backported patch for Linux 3.2 ... 3.14 has been queued by GregKH for the 3.10 kernel here:

http://git.kernel.org/cgit/linux/kernel/git/stable/stable-queue.git/tree/queue-3.10/can-dev-fix-crtlmode_supported-check.patch?id=332373aa9a50a1c18027be7352d6138fa74263d0

I already queued this up while going through commits with 'cc: stable', thanks.

Ben.

Signature · 2 lines
Ben Hutchings
Never attribute to conspiracy what can adequately be explained by stupidity.
Applied
#5 lore raw
In reply to Oliver Hartkopp
Quoted 6 lines · Oliver Hartkopp

Hello all,

just in the case you are interested to pick these patches up for 3.2 and 3.4 stable:

The backported patch for Linux 3.2 ... 3.14 has been queued by GregKH for the 3.10 kernel here:

Queued up already, as it has stable tag. Thanks!

Quoted 2 lines

http://git.kernel.org/cgit/linux/kernel/git/stable/stable-queue.git/tree/queue-3.10/can-dev-fix-crtlmode_supported-check.patch?id=332373aa9a50a1c18027be7352d6138fa74263d0