Commit f32c80d
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: 915f5ea ("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>1 parent dc96528 commit f32c80d
1 file changed
Lines changed: 8 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2189 | 2189 | | |
2190 | 2190 | | |
2191 | 2191 | | |
2192 | | - | |
2193 | 2192 | | |
2194 | 2193 | | |
2195 | | - | |
2196 | | - | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
2197 | 2197 | | |
2198 | 2198 | | |
2199 | 2199 | | |
| |||
2228 | 2228 | | |
2229 | 2229 | | |
2230 | 2230 | | |
2231 | | - | |
| 2231 | + | |
| 2232 | + | |
2232 | 2233 | | |
2233 | 2234 | | |
2234 | 2235 | | |
| |||
2238 | 2239 | | |
2239 | 2240 | | |
2240 | 2241 | | |
| 2242 | + | |
2241 | 2243 | | |
2242 | 2244 | | |
2243 | 2245 | | |
| |||
2281 | 2283 | | |
2282 | 2284 | | |
2283 | 2285 | | |
2284 | | - | |
| 2286 | + | |
2285 | 2287 | | |
2286 | 2288 | | |
2287 | 2289 | | |
| |||
2326 | 2328 | | |
2327 | 2329 | | |
2328 | 2330 | | |
2329 | | - | |
| 2331 | + | |
2330 | 2332 | | |
2331 | 2333 | | |
2332 | 2334 | | |
| |||
0 commit comments