• Cezary Rojewski's avatar
    ALSA: hda: Fix null-ptr-deref when i915 fails and hdmi is denylisted · 0fcc43e2
    Cezary Rojewski authored
    
    
    If snd_hda_hdmi_codec module is denylisted and any event causes i915
    enumeration to fail, is_likely_hdmi_codec() ends in null-ptr-deref.
    
    As snd_soc_hda is an ASoC-based driver, its initialization is delayed
    until all the necessary components appear in the system - allowing
    actual sound card to enumerate. snd_hda_codec_configure() gets called by
    the avs-driver core during probe_codecs() but the
    snd_hda_codec_device_new(), necessary to complete codecs initialization,
    happens only when codec-component of hda sound card is being probed.
    
    Denylisting snd_hda_codec_hdmi module causes snd_hda_codec_configure()
    to reach: codec_bind_generic() -> is_likely_hdmi_codec() which makes use
    of ->wcaps and at this point the it isn't initialized yet - again,
    requires completion of snd_hda_codec_device_new().
    Signed-off-by: default avatarCezary Rojewski <cezary.rojewski@intel.com>
    Link: https://lore.kernel.org/r/20220706120230.427296-3-cezary.rojewski@intel.com
    
    Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    0fcc43e2
hda_bind.c 8.11 KB