All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Shawn Guo <shawn.guo@linaro.org>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.10 25/83] soc: qcom: mdt_loader: Drop PT_LOAD check on hash segment
Date: Mon, 11 Oct 2021 15:45:45 +0200	[thread overview]
Message-ID: <20211011134509.230620469@linuxfoundation.org> (raw)
In-Reply-To: <20211011134508.362906295@linuxfoundation.org>

From: Shawn Guo <shawn.guo@linaro.org>

[ Upstream commit 833d51d7c66d6708abbc02398892b96b950167b9 ]

PT_LOAD type denotes that the segment should be loaded into the final
firmware memory region.  Hash segment is not one such, because it's only
needed for PAS init and shouldn't be in the final firmware memory region.
That's why mdt_phdr_valid() explicitly reject non PT_LOAD segment and
hash segment.  This actually makes the hash segment type check in
qcom_mdt_read_metadata() unnecessary and redundant.  For a hash segment,
it won't be loaded into firmware memory region anyway, due to the
QCOM_MDT_TYPE_HASH check in mdt_phdr_valid(), even if it has a PT_LOAD
type for some reason (misusing or abusing?).

Some firmware files on Sony phones are such examples, e.g WCNSS firmware
of Sony Xperia M4 Aqua phone.  The type of hash segment is just PT_LOAD.
Drop the unnecessary hash segment type check in qcom_mdt_read_metadata()
to fix firmware loading failure on these phones, while hash segment is
still kept away from the final firmware memory region.

Fixes: 498b98e93900 ("soc: qcom: mdt_loader: Support loading non-split images")
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20210828070202.7033-1-shawn.guo@linaro.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/soc/qcom/mdt_loader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/qcom/mdt_loader.c b/drivers/soc/qcom/mdt_loader.c
index eba7f76f9d61..6034cd8992b0 100644
--- a/drivers/soc/qcom/mdt_loader.c
+++ b/drivers/soc/qcom/mdt_loader.c
@@ -98,7 +98,7 @@ void *qcom_mdt_read_metadata(const struct firmware *fw, size_t *data_len)
 	if (ehdr->e_phnum < 2)
 		return ERR_PTR(-EINVAL);
 
-	if (phdrs[0].p_type == PT_LOAD || phdrs[1].p_type == PT_LOAD)
+	if (phdrs[0].p_type == PT_LOAD)
 		return ERR_PTR(-EINVAL);
 
 	if ((phdrs[1].p_flags & QCOM_MDT_TYPE_MASK) != QCOM_MDT_TYPE_HASH)
-- 
2.33.0




  parent reply	other threads:[~2021-10-11 13:53 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-11 13:45 [PATCH 5.10 00/83] 5.10.73-rc1 review Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 01/83] Partially revert "usb: Kconfig: using select for USB_COMMON dependency" Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 02/83] usb: chipidea: ci_hdrc_imx: Also search for phys phandle Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 03/83] USB: cdc-acm: fix racy tty buffer accesses Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 04/83] USB: cdc-acm: fix break reporting Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 05/83] usb: typec: tcpm: handle SRC_STARTUP state if cc changes Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 06/83] drm/nouveau/kms/tu102-: delay enabling cursor until after assign_windows Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 07/83] xen/privcmd: fix error handling in mmap-resource processing Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 08/83] mmc: meson-gx: do not use memcpy_to/fromio for dram-access-quirk Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 09/83] mmc: sdhci-of-at91: wait for calibration done before proceed Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 10/83] mmc: sdhci-of-at91: replace while loop with read_poll_timeout Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 11/83] ovl: fix missing negative dentry check in ovl_rename() Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 12/83] ovl: fix IOCB_DIRECT if underlying fs doesnt support direct IO Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 13/83] nfsd: fix error handling of register_pernet_subsys() in init_nfsd() Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 14/83] nfsd4: Handle the NFSv4 READDIR dircount hint being zero Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 15/83] SUNRPC: fix sign error causing rpcsec_gss drops Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 16/83] xen/balloon: fix cancelled balloon action Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 17/83] ARM: dts: omap3430-sdp: Fix NAND device node Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 18/83] ARM: dts: imx6dl-yapp4: Fix lp5562 LED driver probe Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 19/83] ARM: dts: qcom: apq8064: use compatible which contains chipid Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 20/83] riscv: Flush current cpu icache before other cpus Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 21/83] bus: ti-sysc: Add break in switch statement in sysc_init_soc() Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 22/83] soc: qcom: socinfo: Fixed argument passed to platform_set_data() Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 23/83] ARM: dts: qcom: apq8064: Use 27MHz PXO clock as DSI PLL reference Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 24/83] ARM: at91: pm: do not panic if ram controllers are not enabled Greg Kroah-Hartman
2021-10-11 13:45 ` Greg Kroah-Hartman [this message]
2021-10-11 13:45 ` [PATCH 5.10 26/83] ARM: dts: imx: Add missing pinctrl-names for panel on M53Menlo Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 27/83] ARM: dts: imx: Fix USB host power regulator polarity " Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 28/83] ARM: dts: imx6qdl-pico: Fix Ethernet support Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 29/83] PCI: hv: Fix sleep while in non-sleep context when removing child devices from the bus Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 30/83] ath5k: fix building with LEDS=m Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 31/83] arm64: dts: qcom: pm8150: use qcom,pm8998-pon binding Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 32/83] xtensa: use CONFIG_USE_OF instead of CONFIG_OF Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 33/83] xtensa: call irqchip_init only when CONFIG_USE_OF is selected Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 34/83] iwlwifi: pcie: add configuration of a Wi-Fi adapter on Dell XPS 15 Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 35/83] bpf, arm: Fix register clobbering in div/mod implementation Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 36/83] soc: ti: omap-prm: Fix external abort for am335x pruss Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 37/83] bpf: Fix integer overflow in prealloc_elems_and_freelist() Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 38/83] net/mlx5e: IPSEC RX, enable checksum complete Greg Kroah-Hartman
2021-10-11 13:45 ` [PATCH 5.10 39/83] net/mlx5: E-Switch, Fix double allocation of acl flow counter Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 40/83] phy: mdio: fix memory leak Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 41/83] net_sched: fix NULL deref in fifo_set_limit() Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 42/83] powerpc/fsl/dts: Fix phy-connection-type for fm1mac3 Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 43/83] ptp_pch: Load module automatically if ID matches Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 44/83] arm64: dts: ls1028a: add missing CAN nodes Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 45/83] dt-bindings: drm/bridge: ti-sn65dsi86: Fix reg value Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 46/83] ARM: imx6: disable the GIC CPU interface before calling stby-poweroff sequence Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 47/83] net: bridge: use nla_total_size_64bit() in br_get_linkxstats_size() Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 48/83] net: bridge: fix under estimation " Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 49/83] net/sched: sch_taprio: properly cancel timer from taprio_destroy() Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 50/83] net: sfp: Fix typo in state machine debug string Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 51/83] netlink: annotate data races around nlk->bound Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 52/83] perf jevents: Tidy error handling Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 53/83] bus: ti-sysc: Use CLKDM_NOAUTO for dra7 dcan1 for errata i893 Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 54/83] drm/sun4i: dw-hdmi: Fix HDMI PHY clock setup Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 55/83] video: fbdev: gbefb: Only instantiate device when built for IP32 Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 56/83] drm/nouveau: avoid a use-after-free when BO init fails Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 57/83] drm/nouveau/kms/nv50-: fix file release memory leak Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 58/83] drm/nouveau/debugfs: " Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 59/83] gve: Correct available tx qpl check Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 60/83] gve: Avoid freeing NULL pointer Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 61/83] rtnetlink: fix if_nlmsg_stats_size() under estimation Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 62/83] gve: fix gve_get_stats() Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 63/83] gve: report 64bit tx_bytes counter from gve_handle_report_stats() Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 64/83] i40e: fix endless loop under rtnl Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 65/83] i40e: Fix freeing of uninitialized misc IRQ vector Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 66/83] net: prefer socket bound to interface when not in VRF Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 67/83] powerpc/iommu: Report the correct most efficient DMA mask for PCI devices Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 68/83] i2c: acpi: fix resource leak in reconfiguration device addition Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 69/83] i2c: mediatek: Add OFFSET_EXT_CONF setting back Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 70/83] riscv/vdso: make arch_setup_additional_pages wait for mmap_sem for write killable Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 71/83] bpf, s390: Fix potential memory leak about jit_data Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 72/83] RISC-V: Include clone3() on rv32 Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 73/83] powerpc/bpf: Fix BPF_MOD when imm == 1 Greg Kroah-Hartman
2021-10-11 17:29   ` Naresh Kamboju
2021-10-11 17:34     ` Naresh Kamboju
2021-10-11 13:46 ` [PATCH 5.10 74/83] powerpc/bpf: Fix BPF_SUB when imm == 0x80000000 Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 75/83] powerpc/64s: fix program check interrupt emergency stack path Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 76/83] pseries/eeh: Fix the kdump kernel crash during eeh_pseries_init Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 77/83] x86/platform/olpc: Correct ifdef symbol to intended CONFIG_OLPC_XO15_SCI Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 78/83] x86/Kconfig: Correct reference to MWINCHIP3D Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 79/83] x86/sev: Return an error on a returned non-zero SW_EXITINFO1[31:0] Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 80/83] x86/entry: Correct reference to intended CONFIG_64_BIT Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 81/83] x86/entry: Clear X86_FEATURE_SMAP when CONFIG_X86_SMAP=n Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 82/83] x86/hpet: Use another crystalball to evaluate HPET usability Greg Kroah-Hartman
2021-10-11 13:46 ` [PATCH 5.10 83/83] scsi: ufs: core: Fix task management completion Greg Kroah-Hartman
2021-10-11 15:03   ` Hunter, Adrian
2021-10-11 15:30     ` Greg Kroah-Hartman
2021-10-11 16:16 ` [PATCH 5.10 00/83] 5.10.73-rc1 review Florian Fainelli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211011134509.230620469@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=sashal@kernel.org \
    --cc=shawn.guo@linaro.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.