Skip to contentSkip to conversation

ALSA: hda: Always check capability at opening a hwdep

PATCH In review Takashi Iwai 2 participants 2 messages Dec 3, 2024 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: hda: Always check capability at opening a hwdep

We have a capability check at hda_hwdep_open(), but it's applied only conditionally and the check is skipped when CONFIG_SND_DEBUG_VERBOSE is set. This is rather inconsistent behavior, and we should apply the check always no matter which config is chosen.

---
 sound/pci/hda/hda_hwdep.c | 2 --
 1 file changed, 2 deletions(-)
sound/pci/hda/hda_hwdep.c +0 -2
index 727f39acedfc..9325e5c3cbe6 100644
@@ -84,10 +84,8 @@ static int hda_hwdep_ioctl_compat(struct snd_hwdep *hw, struct file *file,
 
 static int hda_hwdep_open(struct snd_hwdep *hw, struct file *file)
 {
-#ifndef CONFIG_SND_DEBUG_VERBOSE
 	if (!capable(CAP_SYS_RAWIO))
 		return -EACCES;
-#endif
 	return 0;
 }
 
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Takashi Iwai

We have a capability check at hda_hwdep_open(), but it's applied only conditionally and the check is skipped when CONFIG_SND_DEBUG_VERBOSE is set. This is rather inconsistent behavior, and we should apply the check always no matter which config is chosen.

It makes sense.

Signature · 2 lines
Jaroslav Kysela <[email protected]>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.