Gergo Koteles
9c75601926
ASoC: tas2781: check the validity of prm_no/cfg_no
...
commit f32c80d34249e1cfb2e647ab3c8ef38a460c787f upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-01-01 12:42:40 +00:00
..
2023-08-14 13:10:03 +01:00
2023-12-13 18:45:19 +01:00
2023-09-01 15:38:29 +02:00
2023-08-14 13:10:15 +01:00
2023-08-14 13:10:06 +01:00
2023-08-14 13:10:22 +01:00
2024-01-01 12:42:40 +00:00
2023-10-13 18:40:27 +01:00
2024-01-01 12:42:34 +00:00
2023-09-19 13:48:38 +01:00
2023-05-17 10:37:07 +09:00
2023-08-14 13:10:30 +01:00
2023-08-14 13:10:08 +01:00
2023-11-28 17:19:44 +00:00
2023-08-14 13:10:21 +01:00
2023-08-14 13:10:28 +01:00
2023-11-28 17:19:42 +00:00
2023-09-11 01:23:53 +01:00
2023-10-09 13:13:50 +01:00
2023-12-13 18:45:35 +01:00
2023-08-15 19:23:00 +01:00
2023-08-16 14:47:20 +01:00
2023-09-11 01:23:54 +01:00
2023-11-28 17:19:42 +00:00
2023-08-14 13:10:29 +01:00
2023-08-14 13:10:10 +01:00
2023-09-01 15:38:29 +02:00
2023-08-14 13:10:17 +01:00
2023-09-11 01:23:51 +01:00
2023-11-28 17:19:47 +00:00
2023-08-14 13:10:27 +01:00
2023-08-14 13:10:16 +01:00
2023-03-20 13:09:35 +00:00
2023-07-18 15:19:03 +01:00
2023-06-15 13:53:24 +01:00
2023-07-31 23:24:01 +01:00
2023-10-09 13:03:28 +01:00
2023-08-28 16:56:54 +02:00
2023-09-29 14:17:49 +02:00
2023-11-28 17:20:04 +00:00
2023-11-20 11:59:37 +01:00
2023-09-22 17:33:04 +01:00
2023-08-14 22:10:35 +01:00
2023-12-13 18:45:31 +01:00
2023-11-28 17:20:04 +00:00
2023-08-28 16:13:03 +02:00
2023-09-11 01:23:50 +01:00