]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ALSA: hda: Always check capability at opening a hwdep
authorTakashi Iwai <tiwai@suse.de>
Tue, 3 Dec 2024 13:52:47 +0000 (14:52 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 3 Dec 2024 14:20:31 +0000 (15:20 +0100)
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.

Link: https://patch.msgid.link/20241203135248.19840-1-tiwai@suse.de
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_hwdep.c

index 727f39acedfcbea117b259c7a1c3d44a06b93162..9325e5c3cbe6c61ee0b47d48d8177b19bc5f1cdd 100644 (file)
@@ -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;
 }