Re: [PATCH v2 2/2] ASoC: cs35l41: Don't hard-code the number of otp_elem in the array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 3/28/22 16:56, Lucas tanure wrote:
On 3/28/22 05:22, Hui Wang wrote:
The CS35L41_NUM_OTP_ELEM is 100, but only 99 entries are defined in
the array otp_map_1/2[CS35L41_NUM_OTP_ELEM], this will trigger UBSAN
to report a shift-out-of-bounds warning in the cs35l41_otp_unpack()
since the last entry in the array will resuilt in GENMASK(-1, 0).
result

To fix it, removing the definition CS35L41_NUM_OTP_ELEM and use
ARRAY_SIZE to calculate the number of elements dynamically.
This a plain out-of-bounds access issue, you could just say that.
And at the end, you could say that UBSAN reported the issue.

Also the title should start with Fix, like:
"Fix out-of-bounds access in cs35l41_otp_packed_element_t"


Fixes: 6450ef559056 ("ASoC: cs35l41: CS35L41 Boosted Smart Amplifier")
Signed-off-by: Hui Wang <hui.wang@xxxxxxxxxxxxx>

You are missing the Fixes tag.

OK, got it, will address all comment.

Thanks.




[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux