[ciqlts8 6] CVE-2022-50050#777
Merged
Merged
Conversation
jira VULN-70503 cve CVE-2022-50050 commit-author Takashi Iwai <tiwai@suse.de> commit 94c1ceb upstream-diff | Adjusted context due to missing commit 71778f7("ASoC: SOF: Intel: hda: Define rom_status_reg in sof_intel_dsp_desc") snprintf() returns the would-be-filled size when the string overflows the given buffer size, hence using this value may result in the buffer overflow (although it's unrealistic). This patch replaces with a safer version, scnprintf() for papering over such a potential issue. Fixes: 29c8e43 ("ASoC: SOF: Intel: hda: add extended rom status dump to error log") Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20220801165420.25978-4-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org> (cherry picked from commit 94c1ceb) Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
🔍 Interdiff Analysis
diff -u b/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
--- b/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -533,7 +533,7 @@
- chip = get_chip_info(sdev->pdata);
+
for (i = 0; i < HDA_EXT_ROM_STATUS_SIZE; i++) {
- value = snd_sof_dsp_read(sdev, HDA_DSP_BAR, chip->rom_status_reg + i * 0x4);
+ value = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_SRAM_REG_ROM_STATUS + i * 0x4);
len += snprintf(msg + len, sizeof(msg) - len, " 0x%x", value);
}
- dev_printk(level, sdev->dev, "extended rom status: %s", msg);
+ dev_err(sdev->dev, "extended rom status: %s", msg);
@@ -536,7 +536,7 @@ INTERDIFF: rejected hunk from patch1, cannot diff context
for (i = 0; i < HDA_EXT_ROM_STATUS_SIZE; i++) {
value = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_SRAM_REG_ROM_STATUS + i * 0x4);
- len += snprintf(msg + len, sizeof(msg) - len, " 0x%x", value);
+ len += scnprintf(msg + len, sizeof(msg) - len, " 0x%x", value);
}
dev_err(sdev->dev, "extended rom status: %s", msg);
@@ -574,7 +574,7 @@ INTERDIFF: rejected hunk from patch2, cannot diff context
chip = get_chip_info(sdev->pdata);
for (i = 0; i < HDA_EXT_ROM_STATUS_SIZE; i++) {
value = snd_sof_dsp_read(sdev, HDA_DSP_BAR, chip->rom_status_reg + i * 0x4);
- len += snprintf(msg + len, sizeof(msg) - len, " 0x%x", value);
+ len += scnprintf(msg + len, sizeof(msg) - len, " 0x%x", value);
}
dev_printk(level, sdev->dev, "extended rom status: %s", msg);This is an automated interdiff check for backported commits. |
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.
DESCRIPTION
Not a clean cherry pick due to missing
71778f7("ASoC: SOF: Intel: hda: Define rom_status_reg in sof_intel_dsp_desc").
Not added as a pre-req because it is part of a bigger patchset upstream.
https://lore.kernel.org/all/20220414184817.362215-14-pierre-louis.bossart@linux.intel.com/
Otherwise, the change is straightfoward.
COMMITS
TESTING
BUILD
Kselftests
Check_kernel_commits
Run interdiff
Check colordiff instead

colordiff.log
That's due tot missing commit
71778f7("ASoC: SOF: Intel: hda: Define rom_status_reg in sof_intel_dsp_desc").
Not added because it was part of a bigger patchset
https://lore.kernel.org/all/20220414184817.362215-14-pierre-louis.bossart@linux.intel.com/
And the last one is due to missing commit
34bfba9 ("ASoC: SOF: Intel: hda: Use DEBUG log level for optional prints").
Not revelant here.
Run jira_pr_check