lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 22 Aug 2013 23:23:16 +0200
From:	Takashi Iwai <tiwai@...e.de>
To:	Stratos Karafotis <stratosk@...aphore.gr>
Cc:	Jaroslav Kysela <perex@...ex.cz>, alsa-devel@...a-project.org,
	"linux-kernel@...r.kernel.org >> LKML" <linux-kernel@...r.kernel.org>
Subject: Re: oops during boot with CONFIG_SND_DYNAMIC_MINORS not set

At Thu, 22 Aug 2013 19:03:44 +0300,
Stratos Karafotis wrote:
> 
> On 08/22/2013 10:59 AM, Takashi Iwai wrote:
> > At Thu, 22 Aug 2013 00:42:41 +0300,
> > Stratos Karafotis wrote:
> >>
> >> Hi,
> >>
> >> I get the following oops during boot when build with CONFIG_SND_DYNAMIC_MINORS
> >> not set (3.11-rc6).
> >> The issue is vanished building the kernel with CONFIG_SND_DYNAMIC_MINORS=y
> >> as suggested in printk message.
> >>
> >> Regards,
> >> Stratos
> >>
> >>
> > 
> > Could you check the patch below?
> > Thanks!
> > 
> > 
> > Takashi
> > 
> > ---
> > From: Takashi Iwai <tiwai@...e.de>
> > Subject: [PATCH] ALSA: hda - Fix NULL dereference with CONFIG_SND_DYNAMIC_MINORS=n
> > 
> > Without the dynamic minor assignment, HDMI codec may have less PCM
> > instances than the number of pins, which eventually leads to Oops.
> > 
> > Reported-by: Stratos Karafotis <stratosk@...aphore.gr>
> > Cc: <stable@...r.kernel.org>
> > Signed-off-by: Takashi Iwai <tiwai@...e.de>
> > ---
> >   sound/pci/hda/patch_hdmi.c | 3 +++
> >   1 file changed, 3 insertions(+)
> > 
> > diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
> > index 030ca86..e2cb92b 100644
> > --- a/sound/pci/hda/patch_hdmi.c
> > +++ b/sound/pci/hda/patch_hdmi.c
> > @@ -1781,6 +1781,9 @@ static int generic_hdmi_build_controls(struct hda_codec *codec)
> >   		struct snd_pcm_chmap *chmap;
> >   		struct snd_kcontrol *kctl;
> >   		int i;
> > +
> > +		if (pin_idx >= codec->num_pcms)
> > +			break;
> >   		err = snd_pcm_add_chmap_ctls(codec->pcm_info[pin_idx].pcm,
> >   					     SNDRV_PCM_STREAM_PLAYBACK,
> >   					     NULL, 0, pin_idx, &chmap);
> > 
> 
> Hi,
> 
> Unfortunately, still the same problem after applying your patch.

Bah, it's a wrong one.  The patch below should work better.
Sorry for inconvenience.


Takashi

---
From: Takashi Iwai <tiwai@...e.de>
Subject: [PATCH v2] ALSA: hda - Fix NULL dereference with CONFIG_SND_DYNAMIC_MINORS=n

Without the dynamic minor assignment, HDMI codec may have less PCM
instances than the number of pins, which eventually leads to Oops.

Reported-by: Stratos Karafotis <stratosk@...aphore.gr>
Cc: <stable@...r.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@...e.de>
---
 sound/pci/hda/patch_hdmi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 030ca86..9f35862 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1781,6 +1781,9 @@ static int generic_hdmi_build_controls(struct hda_codec *codec)
 		struct snd_pcm_chmap *chmap;
 		struct snd_kcontrol *kctl;
 		int i;
+
+		if (!codec->pcm_info[pin_idx].pcm)
+			break;
 		err = snd_pcm_add_chmap_ctls(codec->pcm_info[pin_idx].pcm,
 					     SNDRV_PCM_STREAM_PLAYBACK,
 					     NULL, 0, pin_idx, &chmap);
-- 
1.8.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ