android_kernel_oneplus_msm8998/sound/soc
Rohit kumar 1e9e68e4ef 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.

Change-Id: I40d070b1357f016eb1622146180e4abb340e5d00
Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Git-commit: ae7d1247d8673ebfd686b17e759d4be391165368
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
2018-12-26 07:58:34 +01:00
..
adi
atmel ASoC: atmel-classd: fix audio clock rate 2017-04-08 09:53:31 +02:00
au1x ASoC: au1x: Fix timeout tests in au1xac97c_ac97_read() 2018-05-30 07:48:52 +02:00
bcm
blackfin
cirrus ASoC: cirrus: i2s: Fix {TX|RX}LinCtrlData setup 2018-07-03 11:21:27 +02:00
codecs ASoC: wsa881x: Fix regcache sync issue during playback 2018-12-26 07:53:58 +01:00
davinci
dwc
fsl ASoC: fsl_esai: Fix divisor calculation failure at lower ratio 2018-05-02 07:53:42 -07:00
generic ASoC: simple-card: Fix misleading error message 2018-02-16 20:09:36 +01:00
intel ASoC: Intel: cht_bsw_max98090_ti: Fix jack initialization 2018-08-17 20:56:45 +02:00
jz4740
kirkwood
mediatek ASoC: mediatek: add i2c dependency 2018-02-25 11:03:48 +01:00
msm Synchronize codes for OnePlus5 & 5T OxygenOS 9.0.0 2018-12-26 11:02:39 +08:00
mxs
nuc900 ASoC: nuc900: Fix a loop timeout test 2018-03-22 09:23:29 +01:00
omap
pxa ASoC: pxa: Fix module autoload for platform drivers 2018-08-06 16:24:40 +02:00
qcom
rockchip ASoC: rockchip: use __maybe_unused to hide st_irq_syscfg_resume 2018-02-25 11:03:49 +01:00
samsung ASoC: samsung: i2s: Ensure the RCLK rate is properly determined 2018-05-30 07:49:17 +02:00
sh ASoC: rsnd: SSI PIO adjust to 24bit mode 2018-04-13 19:50:11 +02:00
sirf
spear
sti
sunxi
tegra
txx9
ux500 ASoC: ux500: add MODULE_LICENSE tag 2018-02-25 11:03:37 +01:00
xtensa
zte
Kconfig
Makefile
soc-ac97.c
soc-cache.c
soc-compress.c ASoC: compress: Derive substream from stream based on direction 2017-07-27 15:06:04 -07:00
soc-core.c ASoC: core: Fix possible NULL pointer dereference 2017-08-21 23:05:03 -07:00
soc-dapm.c Merge android-4.4.139 (7ba5557) into msm-4.4 2018-07-03 12:24:56 -07:00
soc-devres.c
soc-generic-dmaengine-pcm.c
soc-io.c
soc-jack.c
soc-ops.c ASoC: Fix UBSAN warning at snd_soc_get/put_volsw_sx() 2018-12-26 07:58:34 +01:00
soc-pcm.c Merge android-4.4.146 (13962260) into msm-4.4 2018-08-07 15:36:56 +05:30
soc-topology.c ASoC: topology: create TLV data for dapm widgets 2018-05-30 07:49:12 +02:00
soc-utils.c