Unverified Commit 5addb4b8 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!10400 Fix CVE-2024-41069

Merge Pull Request from: @ci-robot 
 
PR sync from: Zheng Yejian <zhengyejian1@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/7S737LCICWONJRZ6P65HNBWPWDJ7MNEG/ 
Amadeusz Sławiński (2):
  ASoC: topology: Fix references to freed memory
  ASoC: topology: Fix route memory corruption


-- 
2.25.1
 
https://gitee.com/src-openeuler/kernel/issues/IAGELE 
 
Link:https://gitee.com/openeuler/kernel/pulls/10400 
parents 3a0f363b 0c3465c9
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -1151,13 +1151,19 @@ static int soc_tplg_dapm_graph_elems_load(struct soc_tplg *tplg,
			SNDRV_CTL_ELEM_ID_NAME_MAXLEN)
			return -EINVAL;

		route.source = elem->source;
		route.sink = elem->sink;
		route.source = devm_kstrdup(tplg->dev, elem->source, GFP_KERNEL);
		route.sink = devm_kstrdup(tplg->dev, elem->sink, GFP_KERNEL);
		if (!route.source || !route.sink)
			return -ENOMEM;

		route.connected = NULL; /* set to NULL atm for tplg users */
		if (strnlen(elem->control, SNDRV_CTL_ELEM_ID_NAME_MAXLEN) == 0)
		if (strnlen(elem->control, SNDRV_CTL_ELEM_ID_NAME_MAXLEN) == 0) {
			route.control = NULL;
		else
			route.control = elem->control;
		} else {
			route.control = devm_kstrdup(tplg->dev, elem->control, GFP_KERNEL);
			if (!route.control)
				return -ENOMEM;
		}

		soc_tplg_add_route(tplg, &route);