Skip to contentSkip to conversation

ALSA: hda: Abort capability probe on invalid capability

PATCH Superseded Ughreja, Rakesh A 3 participants 4 messages Oct 18, 2017 – Oct 19, 2017 Sound

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ALSA: hda: Abort capability probe on invalid capability

From: Rakesh Ughreja <[email protected]>

Due to bugs in BIOS it's possible that the HDA capability link list is not constructed properly. This may lead to driver going into unknown state. So whenever driver discovers unknown HDA capability, log it as error and stop traversing the link list further.

---
 sound/hda/hdac_controller.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
sound/hda/hdac_controller.c +2 -1
index 978dc18..8f7d0d9 100644
@@ -314,7 +314,8 @@ int snd_hdac_bus_parse_capabilities(struct hdac_bus *bus)
 			break;
 
 		default:
-			dev_dbg(bus->dev, "Unknown capability %d\n", cur_cap);
+			dev_err(bus->dev, "Unknown capability %d\n", cur_cap);
+			cur_cap = 0;
 			break;
 		}
 
Signature · 1 line
2.7.4
#1 lore raw
Quoted 3 lines · Rakesh A

From: Rakesh Ughreja <[email protected]>

Due to bugs in BIOS it's possible that the HDA capability link

It maybe due to BIOS bug or some other issue, lets not quantify that please.

I would say "On reading wrong capablity pointer values we may crash...

Quoted 2 lines

list is not constructed properly. This may lead to driver going into unknown state.

I dont think we maintain driver states which are going wrong here

Quoted 3 lines

So whenever driver discovers unknown HDA capability, log it as error and stop traversing the link list further.

that sound good

Quoted 23 lines
---
 sound/hda/hdac_controller.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
sound/hda/hdac_controller.c +2 -1
index 978dc18..8f7d0d9 100644
@@ -314,7 +314,8 @@ int snd_hdac_bus_parse_capabilities(struct hdac_bus *bus)
 			break;
 
 		default:
-			dev_dbg(bus->dev, "Unknown capability %d\n", cur_cap);
+			dev_err(bus->dev, "Unknown capability %d\n", cur_cap);
+			cur_cap = 0;
 			break;
 		}
 
Signature · 1 line
2.7.4
Signature · 1 line
~Vinod
#2 lore raw
Quoted 21 lines

-----Original Message-----
From: Koul, Vinod
Sent: Wednesday, October 18, 2017 9:57 PM
To: Ughreja, Rakesh A <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [PATCH v2] ALSA: hda: Abort capability probe on invalid capability

Quoted 3 lines · Rakesh A

From: Rakesh Ughreja <[email protected]>

Due to bugs in BIOS it's possible that the HDA capability link

It maybe due to BIOS bug or some other issue, lets not quantify that please.

I would say "On reading wrong capablity pointer values we may crash...

Quoted 2 lines

list is not constructed properly. This may lead to driver going into unknown state.

Quoted 7 lines

I dont think we maintain driver states which are going wrong here

Quoted 3 lines

So whenever driver discovers unknown HDA capability, log it as error and stop traversing the link list further.

that sound good

Hi Vinod, Takashi,

Are you both ok with following commit message ?

On reading wrong capability pointer values driver may crash, so whenever driver discovers unknown HDA capability, log it as error and stop traversing the link list further.

Regards,
Rakesh

#3 lore raw
Quoted 30 lines · Rakesh A
Quoted 22 lines

-----Original Message-----
From: Koul, Vinod
Sent: Wednesday, October 18, 2017 9:57 PM
To: Ughreja, Rakesh A <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [PATCH v2] ALSA: hda: Abort capability probe on invalid capability

Quoted 3 lines · Rakesh A

From: Rakesh Ughreja <[email protected]>

Due to bugs in BIOS it's possible that the HDA capability link

It maybe due to BIOS bug or some other issue, lets not quantify that please.

I would say "On reading wrong capablity pointer values we may crash...

Quoted 2 lines

list is not constructed properly. This may lead to driver going into unknown state.

Quoted 7 lines

I dont think we maintain driver states which are going wrong here

Quoted 3 lines

So whenever driver discovers unknown HDA capability, log it as error and stop traversing the link list further.

that sound good

Quoted 7 lines

Hi Vinod, Takashi,

Are you both ok with following commit message ?

On reading wrong capability pointer values driver may crash, so whenever driver discovers unknown HDA capability, log it as error and stop traversing the link list further.

Looks good to me.

thanks,

Takashi