linux/drivers/remoteproc
Daniele Alessandrelli fc1490c621 UPSTREAM: remoteproc: core: Fix rproc->firmware free in rproc_set_firmware()
rproc_alloc_firmware() (called by rproc_alloc()) can allocate
rproc->firmware using kstrdup_const() and therefore should be freed
using kfree_const(); however, rproc_set_firmware() frees it using the
simple kfree(). This causes a kernel oops if a constant string is passed
to rproc_alloc() and rproc_set_firmware() is subsequently called.

Fix the above issue by using kfree_const() to free rproc->firmware in
rproc_set_firmware().

Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Daniele Alessandrelli <daniele.alessandrelli@intel.com>
Link: https://lore.kernel.org/r/20210118165904.719999-1-daniele.alessandrelli@linux.intel.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>

[juhyung: A kernel panic was observed with downstream Qualcomm's
qcom_spss and spss_utils modules on production phones.
drivers/remoteproc/qcom_spss.c's qcom_spss_set_fw_name() have upstream's
rproc_set_firmware() logic duplicated and hence needs its own fix (change
to call rproc_set_firmware() directly) to fully fix the kernel panic,
but remoteproc_core needs to be fixed too.]

Change-Id: I7d993e38d4babc30562dd47c366cba9fda388130
(cherry picked from commit 43d3f2c715)
Signed-off-by: Juhyung Park <qkrwngud825@gmail.com>
2023-01-25 18:48:50 +00:00
..
da8xx_remoteproc.c
imx_rproc.c
ingenic_rproc.c
Kconfig
keystone_remoteproc.c
Makefile
mtk_common.h
mtk_scp_ipi.c
mtk_scp.c
omap_remoteproc.c
omap_remoteproc.h
qcom_common.c
qcom_common.h
qcom_pil_info.c remoteproc: qcom: pil_info: Don't memcpy_toio more than is provided 2022-01-20 09:17:50 +01:00
qcom_pil_info.h
qcom_q6v5_adsp.c This is the 5.10.110 stable release 2022-04-18 17:41:18 +02:00
qcom_q6v5_mss.c remoteproc: qcom_q6v5_mss: Fix some leaks in q6v5_alloc_memory_region 2022-04-08 14:40:26 +02:00
qcom_q6v5_pas.c
qcom_q6v5_wcss.c
qcom_q6v5.c
qcom_q6v5.h
qcom_sysmon.c remoteproc: sysmon: Wait for SSCTL service to come up 2022-08-21 15:16:08 +02:00
qcom_wcnss_iris.c
qcom_wcnss.c This is the 5.10.137 stable release 2022-08-29 16:53:14 +02:00
qcom_wcnss.h
remoteproc_cdev.c
remoteproc_core.c UPSTREAM: remoteproc: core: Fix rproc->firmware free in rproc_set_firmware() 2023-01-25 18:48:50 +00:00
remoteproc_coredump.c UPSTREAM: remoteproc: Fix the wrong default value of is_iomem 2022-02-11 17:30:25 -08:00
remoteproc_debugfs.c UPSTREAM: remoteproc: Fix count check in rproc_coredump_write() 2022-05-13 15:07:09 +00:00
remoteproc_elf_helpers.h
remoteproc_elf_loader.c UPSTREAM: remoteproc: Fix the wrong default value of is_iomem 2022-02-11 17:30:25 -08:00
remoteproc_internal.h
remoteproc_sysfs.c UPSTREAM: remoteproc: Add a rproc_set_firmware() API 2022-01-04 14:15:08 +05:30
remoteproc_virtio.c
st_remoteproc.c
st_slim_rproc.c
stm32_rproc.c
ti_k3_dsp_remoteproc.c
ti_k3_r5_remoteproc.c This is the 5.10.137 stable release 2022-08-29 16:53:14 +02:00
ti_sci_proc.h
wkup_m3_rproc.c