• Curtis Malainey's avatar
    ASoC: soc-core: fix init platform memory handling · df33b662
    Curtis Malainey authored
    commit 09ac6a81 upstream.
    
    snd_soc_init_platform initializes pointers to snd_soc_dai_link which is
    statically allocated and it does this by devm_kzalloc. In the event of
    an EPROBE_DEFER the memory will be freed and the pointers are left
    dangling. snd_soc_init_platform sees the dangling pointers and assumes
    they are pointing to initialized memory and does not reallocate them on
    the second probe attempt which results in a use after free bug since
    devm has freed the memory from the first probe attempt.
    
    Since the intention for snd_soc_dai_link->platform is that it can be set
    statically by the machine driver we need to respect the pointer in the
    event we did not set it but still catch dangling pointers. The solution
    is to add a flag to track whether the pointer was dynamically allocated
    or not.
    Signed-off-by: 's avatarCurtis Malainey <cujomalainey@chromium.org>
    Signed-off-by: 's avatarMark Brown <broonie@kernel.org>
    Cc: Jon Hunter <jonathanh@nvidia.com>
    Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    df33b662
Name
Last commit
Last update
..
ac97 Loading commit data...
ac97_codec.h Loading commit data...
aci.h Loading commit data...
ad1816a.h Loading commit data...
ad1843.h Loading commit data...
adau1373.h Loading commit data...
aess.h Loading commit data...
ak4113.h Loading commit data...
ak4114.h Loading commit data...
ak4117.h Loading commit data...
ak4531_codec.h Loading commit data...
ak4641.h Loading commit data...
ak4xxx-adda.h Loading commit data...
alc5623.h Loading commit data...
asequencer.h Loading commit data...
asound.h Loading commit data...
asoundef.h Loading commit data...
compress_driver.h Loading commit data...
control.h Loading commit data...
core.h Loading commit data...
cs35l33.h Loading commit data...
cs35l34.h Loading commit data...
cs35l35.h Loading commit data...
cs4231-regs.h Loading commit data...
cs4271.h Loading commit data...
cs42l52.h Loading commit data...
cs42l56.h Loading commit data...
cs42l73.h Loading commit data...
cs8403.h Loading commit data...
cs8427.h Loading commit data...
da7213.h Loading commit data...
da7218.h Loading commit data...
da7219-aad.h Loading commit data...
da7219.h Loading commit data...
da9055.h Loading commit data...
designware_i2s.h Loading commit data...
dmaengine_pcm.h Loading commit data...
emu10k1.h Loading commit data...
emu10k1_synth.h Loading commit data...
emu8000.h Loading commit data...
emu8000_reg.h Loading commit data...
emux_legacy.h Loading commit data...
emux_synth.h Loading commit data...
es1688.h Loading commit data...
gus.h Loading commit data...
hda_chmap.h Loading commit data...
hda_codec.h Loading commit data...
hda_component.h Loading commit data...
hda_hwdep.h Loading commit data...
hda_i915.h Loading commit data...
hda_register.h Loading commit data...
hda_regmap.h Loading commit data...
hda_verbs.h Loading commit data...
hdaudio.h Loading commit data...
hdaudio_ext.h Loading commit data...
hdmi-codec.h Loading commit data...
hwdep.h Loading commit data...
i2c.h Loading commit data...
info.h Loading commit data...
initval.h Loading commit data...
jack.h Loading commit data...
l3.h Loading commit data...
max9768.h Loading commit data...
max98088.h Loading commit data...
max98090.h Loading commit data...
max98095.h Loading commit data...
memalloc.h Loading commit data...
minors.h Loading commit data...
mixer_oss.h Loading commit data...
mpu401.h Loading commit data...
omap-hdmi-audio.h Loading commit data...
opl3.h Loading commit data...
opl4.h Loading commit data...
pcm-indirect.h Loading commit data...
pcm.h Loading commit data...
pcm_drm_eld.h Loading commit data...
pcm_iec958.h Loading commit data...
pcm_oss.h Loading commit data...
pcm_params.h Loading commit data...
pt2258.h Loading commit data...
pxa2xx-lib.h Loading commit data...
rawmidi.h Loading commit data...
rt286.h Loading commit data...
rt298.h Loading commit data...
rt5514.h Loading commit data...
rt5645.h Loading commit data...
rt5659.h Loading commit data...
rt5660.h Loading commit data...
rt5663.h Loading commit data...
rt5665.h Loading commit data...
rt5668.h Loading commit data...
rt5670.h Loading commit data...
rt5682.h Loading commit data...
s3c24xx_uda134x.h Loading commit data...
sb.h Loading commit data...
sb16_csp.h Loading commit data...
seq_device.h Loading commit data...
seq_kernel.h Loading commit data...
seq_midi_emul.h Loading commit data...
seq_midi_event.h Loading commit data...
seq_oss.h Loading commit data...
seq_oss_legacy.h Loading commit data...
seq_virmidi.h Loading commit data...
sh_dac_audio.h Loading commit data...
sh_fsi.h Loading commit data...
simple_card.h Loading commit data...
simple_card_utils.h Loading commit data...
snd_wavefront.h Loading commit data...
soc-acpi-intel-match.h Loading commit data...
soc-acpi.h Loading commit data...
soc-dai.h Loading commit data...
soc-dapm.h Loading commit data...
soc-dpcm.h Loading commit data...
soc-topology.h Loading commit data...
soc.h Loading commit data...
soundfont.h Loading commit data...
spear_dma.h Loading commit data...
spear_spdif.h Loading commit data...
sta32x.h Loading commit data...
sta350.h Loading commit data...
tas2552-plat.h Loading commit data...
tas5086.h Loading commit data...
tea6330t.h Loading commit data...
timer.h Loading commit data...
tlv.h Loading commit data...
tlv320aic32x4.h Loading commit data...
tlv320aic3x.h Loading commit data...
tlv320dac33-plat.h Loading commit data...
tpa6130a2-plat.h Loading commit data...
uda134x.h Loading commit data...
uda1380.h Loading commit data...
util_mem.h Loading commit data...
vx_core.h Loading commit data...
wavefront.h Loading commit data...
wm0010.h Loading commit data...
wm1250-ev1.h Loading commit data...
wm2000.h Loading commit data...
wm2200.h Loading commit data...
wm5100.h Loading commit data...
wm8903.h Loading commit data...
wm8904.h Loading commit data...
wm8955.h Loading commit data...
wm8960.h Loading commit data...
wm8962.h Loading commit data...
wm8993.h Loading commit data...
wm8996.h Loading commit data...
wm9081.h Loading commit data...
wm9090.h Loading commit data...
wss.h Loading commit data...