Thread (2 messages) flat view 2 messages, 2 authors, 2020-11-05

Re: [PATCH][next] can: usb: fix potential integer overflow on shift of a int

From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: 2020-11-05 13:07:47
Also in: kernel-janitors, linux-can, lkml

On 11/5/20 12:24 PM, Colin King wrote:
From: Colin Ian King <redacted>

The left shift of int 32 bit integer constant 1 is evaluated using
32 bit arithmetic and then assigned to a signed 64 bit variable. In
the case where time_ref->adapter->ts_used_bits is 32 or more this
can lead to an oveflow. Avoid this by shifting using the BIT_ULL macro
instead.

Addresses-Coverity: ("Unintentional integer overflow")
Fixes: bb4785551f64 ("can: usb: PEAK-System Technik USB adapters driver core")
Signed-off-by: Colin Ian King <redacted>
Applied to linux-can/testing (not to next).

Thanks,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help