Re: [PATCH] counter: microchip-tcb-capture: Fix DT channel validation
William Breathitt Gray <[email protected]> Sun, 2 Aug 2026 21:44:40 +0900
| Newsgroups | org.kernel.vger.linux-iio,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 14 Jul 2026 04:29:10 +0000, Babanpreet Singh wrote:
> mchp_tc_probe() reads the devicetree "reg" cell - a u32, per the API
> contract of of_property_read_u32_index() - into a signed int, so the
> bounds check "channel > 2" fails to reject cell values at or above
> 0x80000000: reinterpreted as a negative int, they compare below 2 and
> pass validation.
>
> A malformed devicetree can therefore drive a negative channel into the
> ATMEL_TC_REG() offset arithmetic, making the driver access syscon
> regmap offsets outside the TC block's register window, and into the
> "t%d_clk" clock-name formatting, where it truncates clk_name (sized
> for "t0_clk".."t2_clk").
>
> [...]
Applied, thanks!
[1/1] counter: microchip-tcb-capture: Fix DT channel validation
commit: f1a3a9946aab611dd2200c01ff122f64b033dad2
Best regards,
--
William Breathitt Gray <[email protected]>