Skip to contentSkip to conversation

interconnect: mediatek: fix Makefile typo for mt8196

PATCH New Breno Rodrigues Alves 2 participants 6 messages Sep 5

Subsystems (11)
Media (V4L/DVB) USB Sound Staging +7 more subsystems
lore
Share & tools
lore
#0 lore raw

PATCH v11 1/3 interconnect: mediatek: fix Makefile typo for mt8196

Correct a copy-paste typo in the MediaTek interconnect Makefile that mapped mt8196.o to CONFIG_INTERCONNECT_MTK_MT8195 instead of MT8196.

Assisted-by OpenCode AI
---
 drivers/interconnect/mediatek/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/interconnect/mediatek/Makefile +1 -1
index 6bd656668..64170ab16 100644
@@ -3,4 +3,4 @@
 obj-$(CONFIG_INTERCONNECT_MTK_DVFSRC_EMI) += icc-emi.o
 obj-$(CONFIG_INTERCONNECT_MTK_MT8183) += mt8183.o
 obj-$(CONFIG_INTERCONNECT_MTK_MT8195) += mt8195.o
-obj-$(CONFIG_INTERCONNECT_MTK_MT8195) += mt8196.o
+obj-$(CONFIG_INTERCONNECT_MTK_MT8196) += mt8196.o
Signature · 1 line
2.43.0
#1 lore raw

PATCH v11 2/3 regulator: mtk-spmi: fix Makefile typo for mt6316

Fix a Makefile typo that incorrectly placed the mt6316-regulator object under the old CONFIG_REGULATOR_MT6315 configuration flag.

Assisted-by OpenCode AI
---
 drivers/regulator/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/Makefile +1 -1
index 5a764cec8..3a0db1be6 100644
@@ -107,7 +107,7 @@ obj-$(CONFIG_REGULATOR_MP886X) += mp886x.o
 obj-$(CONFIG_REGULATOR_MPQ7920) += mpq7920.o
 obj-$(CONFIG_REGULATOR_MT6311) += mt6311-regulator.o
 obj-$(CONFIG_REGULATOR_MT6315) += mt6315-regulator.o
-obj-$(CONFIG_REGULATOR_MT6315)  += mt6316-regulator.o
+obj-$(CONFIG_REGULATOR_MT6316) += mt6316-regulator.o
 obj-$(CONFIG_REGULATOR_MT6323)	+= mt6323-regulator.o
 obj-$(CONFIG_REGULATOR_MT6331)	+= mt6331-regulator.o
 obj-$(CONFIG_REGULATOR_MT6332)	+= mt6332-regulator.o
Signature · 1 line
2.43.0
#2 lore raw

Re: [PATCH v11 2/3] regulator: mtk-spmi: fix Makefile typo for mt6316

Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 5 lines

Fix a Makefile typo that incorrectly placed the mt6316-regulator object under the old CONFIG_REGULATOR_MT6315 configuration flag.

Assisted-by OpenCode AI

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
#3 lore raw

PATCH v11 3/3 media: dvb-core: extirpate defective and unsafe ULE debug block

In reply to Breno Rodrigues Alves

Completely purge the unmaintained DVB_ULE_DEBUG code block from dvb_net.c and its Kconfig definition to eliminate severe lockless race conditions and clean up the unused function signature parameter.

Assisted-by OpenCode AI
---
 drivers/media/dvb-core/Kconfig   | 11 ---------
 drivers/media/dvb-core/dvb_net.c | 42 +-------------------------------
 2 files changed, 1 insertion(+), 52 deletions(-)
drivers/media/dvb-core/Kconfig +0 -11
index 8b3f2d53c..c6a97add8 100644
@@ -67,14 +67,3 @@ config DVB_DEMUX_SECTION_LOSS_LOG
 
 	  If you are unsure about this, say N here.
 
-config DVB_ULE_DEBUG
-	bool "Enable DVB net ULE packet debug messages"
-	depends on DVB_CORE
-	help
-	  Enable extra log messages meant to detect problems while
-	  handling DVB network ULE packet loss inside the Kernel.
-
-	  Should not be enabled on normal cases, as logs can
-	  be very verbose.
-
-	  If you are unsure about this, say N here.
drivers/media/dvb-core/dvb_net.c +1 -41

66 lines not on this page · raw message

Signature · 1 line
2.43.0
#4 lore raw

Re: [PATCH v11 3/3] media: dvb-core: extirpate defective and unsafe ULE debug block

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:

New issues:
- [Low] The patch introduces a severe compilation failure by modifying the call to dvb_net_ule_check_crc() to pass 3 arguments instead of 4, without updating the function's signature to match.

Pre-existing issues:
- [Critical] The network device is unregistered after flushing the workqueues, allowing callbacks to queue works during unregistration, which leads to a Use-After-Free.
- [Critical] Missing bounds checks when parsing ULE extension headers allows malformed packets to cause out-of-bounds memory reads.
--

commit e9caeb2ec9c58e63757d73d1d8a17bcadf35a678
Author: Breno Rodrigues Alves <[email protected]>

media: dvb-core: extirpate defective and unsafe ULE debug block

This commit removes the unmaintained DVB_ULE_DEBUG code block from dvb_net.c and its Kconfig definition. It aims to eliminate race conditions and clean up unused function signature parameters.

Quoted 4 lines
drivers/media/dvb-core/dvb_net.c +0 -0
index a2159b2bc1766..5060b8866de8a 100644

[ ... ]

drivers/media/dvb-core/dvb_net.c static void dvb_net_ule(struct net_device *dev, const u8 *buf, size_t buf_len) · line 806

Quoted 6 lines
drivers/media/dvb-core/dvb_net.c +1 -1
@@ -843,7 +803,7 @@ static void dvb_net_ule(struct net_device *dev, const u8 *buf, size_t buf_len)
 				       *(tail - 2) << 8 |
 				       *(tail - 1);
 
-			dvb_net_ule_check_crc(&h, iov, ule_crc, expected_crc);
+			dvb_net_ule_check_crc(&h, ule_crc, expected_crc);

[Severity: Low]
Does this change miss updating the function signature of dvb_net_ule_check_crc()?

It looks like the invocation now passes 3 arguments, but the function definition for dvb_net_ule_check_crc() still expects the iov array as its second argument, which causes a compilation failure due to too few arguments.

drivers/media/dvb-core/dvb_net.c static void dvb_net_ule(struct net_device *dev, const u8 *buf, size_t buf_len) · line 809

Quoted 3 lines
drivers/media/dvb-core/dvb_net.c +0 -0
 			/* Prepare for next SNDU. */
 			reset_ule(h.priv);

While reviewing this code, I also noticed a couple of issues that are not introduced by this patch, but might be worth addressing:

[Severity: Critical]
This is a pre-existing issue, but I noticed a potential use-after-free when unregistering the network device.

In dvb_net_remove_if(), the workqueues are flushed before the device is unregistered:

	flush_work(&priv->set_multicast_list_wq);
	flush_work(&priv->restart_net_feed_wq);
	pr_info("removed network interface %s\n", net->name);
	unregister_netdev(net);

When unregister_netdev() is called, callbacks can be triggered (such as ndo_set_rx_mode mapping to dvb_net_set_multicast_list) which schedule work back onto set_multicast_list_wq. Could this result in a use-after-free when the pending work executes later, since the priv memory gets freed during teardown?

[Severity: Critical]
This is a pre-existing issue, but it looks like there might be an out-of-bounds read when parsing ULE extension headers.

The handle_ule_extensions() loop iterates over extension headers using handle_one_ule_extension(), which reads memory and advances the pointer:

	p->ule_next_hdr += ext_len;
	p->ule_sndu_type = ntohs( *(__be16 *)(p->ule_next_hdr-2) );

Is it possible for a malformed payload to specify extension lengths that push p->ule_next_hdr past the end of the allocated skb buffer? The loop appears to continue without bounds checking against skb->len, which could cause a page fault on malicious inputs.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
#5 lore raw
In reply to Breno Rodrigues Alves
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 5 lines

Correct a copy-paste typo in the MediaTek interconnect Makefile that mapped mt8196.o to CONFIG_INTERCONNECT_MTK_MT8195 instead of MT8196.

Assisted-by OpenCode AI

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1