can: dev: fix crtlmode_supported check
Marc Kleine-Budde
maintainerQuoted 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 againstcm->flagsis wrong as the content can hold any kind of values.The iproute2 tool sets the bits in
cm->maskandcm->flagsdepending 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
9b1087aa5e86448fe6ad40a58964e35f3ba423d5for 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 |
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 againstcm->flagsis wrong as the content can hold any kind of values.The iproute2 tool sets the bits in
cm->maskandcm->flagsdepending 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
9b1087aa5e86448fe6ad40a58964e35f3ba423d5for Linux 3.2 .. Linux 3.14)Zefan Li <[email protected]> is taking care of v3.4
Marc
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:
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 againstcm->flagsis wrong as the content can hold any kind of values.The iproute2 tool sets the bits in
cm->maskandcm->flagsdepending 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
9b1087aa5e86448fe6ad40a58964e35f3ba423d5for Linux 3.2 .. Linux 3.14)Zefan Li <[email protected]> is taking care of v3.4
Marc
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:
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.
Zefan Li
AppliedQuoted 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!