kernel-open: guard nv_audio_dynamic_power against non-HDA drivers - #1404
Open
bodapatisaikrishna wants to merge 1 commit into
Open
bodapatisaikrishna wants to merge 1 commit into
bodapatisaikrishna wants to merge 1 commit into
Conversation
nv_audio_dynamic_power() calls pci_get_drvdata() on the GPU audio function and casts the result to struct snd_card * without checking the bound driver. When a non-HDA driver like vfio-pci is bound, the drvdata is not a snd_card, and dereferencing it panics the kernel. Add a check that the audio PCI device is actually bound to snd_hda_intel before accessing its driver data. Fixes: NVIDIA#1365 Signed-off-by: bodapatisaikrishna <saikrishnabodapati@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1365
nv_audio_dynamic_power()blindly casts the result ofpci_get_drvdata(audio_pci_dev)tostruct snd_card *. When the audio function is bound to a different driver (e.g. vfio-pci for GPU passthrough), the returned pointer is unrelated driver data and dereferencing it causes a kernel panic.This adds a check that verifies
snd_hda_intelis actually bound before touching the driver data.