Gergo Koteles
f32c80d342
ASoC: tas2781: check the validity of prm_no/cfg_no
...
Add additional checks for program/config numbers to avoid loading from
invalid addresses.
If prm_no/cfg_no is negative, skip uploading program/config.
The tas2781-hda driver caused a NULL pointer dereference after loading
module, and before first runtime_suspend.
the state was:
tas_priv->cur_conf = -1;
tas_priv->tasdevice[i].cur_conf = 0;
program = &(tas_fmw->programs[-1]);
BUG: kernel NULL pointer dereference, address: 0000000000000010
Call Trace:
<TASK>
? __die+0x23/0x70
? page_fault_oops+0x171/0x4e0
? vprintk_emit+0x175/0x2b0
? exc_page_fault+0x7f/0x180
? asm_exc_page_fault+0x26/0x30
? tasdevice_load_block_kernel+0x21/0x310 [snd_soc_tas2781_fmwlib]
tasdevice_select_tuningprm_cfg+0x268/0x3a0 [snd_soc_tas2781_fmwlib]
tasdevice_tuning_switch+0x69/0x710 [snd_soc_tas2781_fmwlib]
tas2781_hda_playback_hook+0xd4/0x110 [snd_hda_scodec_tas2781_i2c]
Fixes: 915f5eadebd2 ("ASoC: tas2781: firmware lib")
CC: <stable@vger.kernel.org>
Signed-off-by: Gergo Koteles <soyer@irl.hu>
Link: https://msgid.link/r/523780155bfdca9bc0acd39efc79ed039454818d.1702591356.git.soyer@irl.hu
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-12-15 13:35:49 +00:00
..
2023-08-02 09:27:39 +02:00
2023-10-26 09:43:11 +02:00
2023-09-25 14:16:16 +02:00
2023-07-16 14:50:56 +02:00
2023-11-10 11:57:51 -08:00
2023-10-06 11:11:40 +02:00
2023-09-15 13:22:06 +02:00
2023-10-31 08:58:36 +01:00
2023-04-06 08:09:36 +02:00
2023-09-15 13:23:01 +02:00
2023-03-20 13:07:05 +00:00
2023-11-09 17:44:52 +01:00
2023-11-10 11:57:51 -08:00
2023-05-22 16:43:47 +02:00
2023-07-16 14:50:56 +02:00
2023-08-18 12:18:24 +02:00
2023-12-15 13:35:49 +00:00
2023-07-16 14:50:56 +02:00
2023-06-13 07:42:08 +02:00
2023-10-31 08:58:36 +01:00
2023-10-27 11:25:07 +02:00
2023-09-15 13:21:35 +02:00
2023-03-20 08:50:02 +01:00
2023-09-04 11:32:21 -07:00
2023-06-21 07:29:10 +02:00