diff options
author | Rohit kumar <rohitkr@codeaurora.org> | 2018-09-11 14:59:21 +0530 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-09-11 11:58:52 +0100 |
commit | ae7d1247d8673ebfd686b17e759d4be391165368 (patch) | |
tree | 2ccae8d334321c51b28558d0528089b8051796ac /net | |
parent | 54a3da1c105ca91c4d32f25c3d9c57a61e9a3467 (diff) | |
download | linux-ae7d1247d8673ebfd686b17e759d4be391165368.tar.gz linux-ae7d1247d8673ebfd686b17e759d4be391165368.tar.bz2 linux-ae7d1247d8673ebfd686b17e759d4be391165368.zip |
ASoC: Fix UBSAN warning at snd_soc_get/put_volsw_sx()
In functions snd_soc_get_volsw_sx() or snd_soc_put_volsw_sx(),
if the result of (min + max) is negative, then fls() returns
signed integer with value as 32. This leads to signed integer
overflow as complete operation is considered as signed integer.
UBSAN: Undefined behaviour in sound/soc/soc-ops.c:382:50
signed integer overflow:
-2147483648 - 1 cannot be represented in type 'int'
Call trace:
[<ffffff852f746fe4>] __dump_stack lib/dump_stack.c:15 [inline]
[<ffffff852f746fe4>] dump_stack+0xec/0x158 lib/dump_stack.c:51
[<ffffff852f7b5f3c>] ubsan_epilogue+0x18/0x50 lib/ubsan.c:164
[<ffffff852f7b6840>] handle_overflow+0xf8/0x130 lib/ubsan.c:195
[<ffffff852f7b68f0>] __ubsan_handle_sub_overflow+0x34/0x44 lib/ubsan.c:211
[<ffffff85307971a0>] snd_soc_get_volsw_sx+0x1a8/0x1f8 sound/soc/soc-ops.c:382
Typecast the operation to unsigned int to fix the issue.
Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'net')
0 files changed, 0 insertions, 0 deletions