[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260114131423.202777-1-zwq2226404116@163.com>
Date: Wed, 14 Jan 2026 21:14:23 +0800
From: "wanquan.zhong" <zwq2226404116@....com>
To: loic.poulain@....qualcomm.com,
chandrashekar.devegowda@...el.com,
chiranjeevi.rapolu@...ux.intel.com,
haijun.liu@...iatek.com,
ricardo.martinez@...ux.intel.com
Cc: netdev@...r.kernel.org,
johannes@...solutions.net,
davem@...emloft.net,
andrew+netdev@...n.ch,
kuba@...nel.org,
pabeni@...hat.com,
linux-kernel@...r.kernel.org,
ryazanov.s.a@...il.com,
wanquan.zhong@...ocom.com
Subject: [PATCH] net: wwan: t7xx: Add CONFIG_WWAN_ADB_PORT for ADB port control
From: "wanquan.zhong" <wanquan.zhong@...ocom.com>
Changes from v2:
1) Add missing 'net:' subsystem prefix to commit subject for compliance
2) Remove redundant "to config" suffix and refine commit wording
3) Split overlong Kconfig help text lines to meet 72-char limit
4) Align EXPERT dependency desc with WWAN subsystem conventions
Add a new Kconfig option CONFIG_WWAN_ADB_PORT to control the ADB debug port
functionality for MediaTek T7xx WWAN modem. This option depends on MTK_T7XX
and EXPERT, defaults to 'y' to avoid breaking existing debugging workflows
while mitigating potential security concerns on specific target systems.
This change addresses security risks on systems such as Google Chrome OS,
where unauthorized root access could lead to malicious ADB configuration
of the WWAN device. The ADB port is restricted via this config only; the
MIPC port remains unrestricted as it is MTK's internal protocol port with
no associated security risks.
While introducing a kernel config option for a single array element may
appear to introduce minor resource overhead, this is the most
straightforward and maintainable implementation approach for this use case.
Alternativeimplementation suggestions from reviewers are welcome.
Signed-off-by: wanquan.zhong <wanquan.zhong@...ocom.com>
---
drivers/net/wwan/Kconfig | 11 +++++++++++
drivers/net/wwan/t7xx/t7xx_port_proxy.c | 2 ++
2 files changed, 13 insertions(+)
diff --git a/drivers/net/wwan/Kconfig b/drivers/net/wwan/Kconfig
index 410b0245114e..3d49dc8491a3 100644
--- a/drivers/net/wwan/Kconfig
+++ b/drivers/net/wwan/Kconfig
@@ -27,6 +27,17 @@ config WWAN_DEBUGFS
elements for each WWAN device in a directory that is corresponding to
the device name: debugfs/wwan/wwanX.
+config WWAN_ADB_PORT
+ bool "MediaTek T7xx ADB port support" if EXPERT
+ depends on MTK_T7XX
+ default y
+ help
+ Enables ADB (Android Debug Bridge) debug port support for MediaTek T7xx WWAN devices.
+
+ This option enables the ADB debug port functionality in the MediaTek T7xx driver,
+ allowing Android Debug Bridge connections through T7xx modems that support
+ this feature. It is primarily used for debugging and development purposes.
+
config WWAN_HWSIM
tristate "Simulated WWAN device"
help
diff --git a/drivers/net/wwan/t7xx/t7xx_port_proxy.c b/drivers/net/wwan/t7xx/t7xx_port_proxy.c
index 4fc131f9632f..9f3b7b1dd4e2 100644
--- a/drivers/net/wwan/t7xx/t7xx_port_proxy.c
+++ b/drivers/net/wwan/t7xx/t7xx_port_proxy.c
@@ -102,6 +102,7 @@ static const struct t7xx_port_conf t7xx_port_conf[] = {
.ops = &ctl_port_ops,
.name = "t7xx_ap_ctrl",
}, {
+#ifdef CONFIG_WWAN_ADB_PORT
.tx_ch = PORT_CH_AP_ADB_TX,
.rx_ch = PORT_CH_AP_ADB_RX,
.txq_index = Q_IDX_ADB,
@@ -112,6 +113,7 @@ static const struct t7xx_port_conf t7xx_port_conf[] = {
.port_type = WWAN_PORT_ADB,
.debug = true,
}, {
+#endif
.tx_ch = PORT_CH_MIPC_TX,
.rx_ch = PORT_CH_MIPC_RX,
.txq_index = Q_IDX_MBIM_MIPC,
--
2.43.0
Powered by blists - more mailing lists