From nobody Mon Feb 9 19:05:45 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D8BF943CED4 for ; Thu, 5 Feb 2026 17:14:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770311659; cv=none; b=c79h8X0p0SnRBaIo3Gd5I9tIWS0YmxTS0W2WSUAWV/i279BxbWA9Xu70Vrckza9i90XbNrqk0Hgv1txjvLMWPf+dGRQUGVyFvDyiNu+HDjHC8a+YTmGF+DQWx79p1hjejhpujGP+Irf2MUuU71ziEs+cto51m/01wfewegZgRhU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770311659; c=relaxed/simple; bh=hpmfNzSCIC5ApGBDTE0elE5AkmLDZ9OmsstHpD/oKEk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uDd3Ba3asBpyxconZitdhm5WSyTcJW7BGJuLA67kHZSgKc83bnxb2qeO/YHXqwZQVg5YiUeW8KIP3oy+RdiJ0pvY45jFDD+MBAXyrMrcFmx0kqttebZULnqPz4If9urQ3j1DSuk79HXEVqDcalBj9BIRIxTxrgO1zeDgEhSF1eM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=FnAFNpA7; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Y6uINJCv; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="FnAFNpA7"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Y6uINJCv" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 615AjhCr2157615 for ; Thu, 5 Feb 2026 17:14:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=K6uxAlpDaZ6 EBOUxGU3VxAdAbWdRRiS7if5bxpU1zcw=; b=FnAFNpA7+DcHitGvUXjDDHYr6NA aF9O7SilomV2gGQE7liag2QkVCRDQv++knj0DWjAdS0uNKDlLHt+qsdb4NiSR4WS nDZZRtVlBHvTeg/ri4gFz3W9JKqwXF8UJrZ59PJ+ovlnSL/OR+locMQ+qLwhm+lm Yu3voBdLWpAxQK+MvoYIETH9fAezKLrPkwatdWeFomzYIqAr95GxyvDrzD2Z8BsQ EvXDsJaVDcC38dLwemuU0aHmtCejwxJVEDp90tpcaX5W6MLDMxjYNpwodRlC/04W oJrQB9dgzWMs+EeO4d/nIbKXXHBNXSw/Gz1XcNUu7NpHgl9/7AWuB2gQl2A== Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4c4gynttra-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 05 Feb 2026 17:14:17 +0000 (GMT) Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-8c6cfd52556so380980085a.0 for ; Thu, 05 Feb 2026 09:14:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1770311657; x=1770916457; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=K6uxAlpDaZ6EBOUxGU3VxAdAbWdRRiS7if5bxpU1zcw=; b=Y6uINJCvEvTft0AI0ovJr0uRGmK8rh1NuAKI6hHfCmRhB2YodN7qzrIvm53N9UrrDP n2XTWU5K+ZI902LlI1l1TdEq92EqLlx1x13jsxDu3jFhOoEI/zJs11ECA8TALGV0nwWq zEFTgXItP5IXzyodbqRUt7hiQE3ZxZmmDc7oBS0cZaWSrmKM3qSPEELf6R/NjDXBCezG GuZXbOUUsUom0ZZrxagcOF5/mP4je0ATsDKcRRiZc6jzDLWn4Jua1klMmuRGwheHBPxp 6AwENNRsPmQUAoULQh90npkgFSahNEvWuk+rtrMFkmoYX3gacXur+88fY74Srs9rcGjz DmNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770311657; x=1770916457; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=K6uxAlpDaZ6EBOUxGU3VxAdAbWdRRiS7if5bxpU1zcw=; b=cjpa1E+fRGPBgO+43Ei0XpH0DafcroBGC7GV35wNTib68sBpAXFmLdeyDyDMrLypXf CCahGNgwimVInDZcY+jhgfwlPNoO396mo3Q3qkTKU58DZH1dHSBoF0s20+XcC6MvpAo+ rDw9gYSXBlYbY/KDD1MUsjRajpLGipLMw0IBVeoOc7+oJojC0eYw1gRQhzMZfjpWRBqr XP980ySnPw/wVIZ9wvY6W9fA9yLkb3jEt3kQ4a7fjnz642JbWPnKfI1LN6uclWGj5jK9 awMvgwNiLEhMYHa6/n6BDdG1QVOWdQFst6v2Z8T1E+QlmN6VfHTplz9rZMFvBj1LKpgU wBgA== X-Forwarded-Encrypted: i=1; AJvYcCUE2Lz5Pq9LhWFeKSdEoL13kFjY1WPs5CmOKGGkjUog97wDFVZJKp5vR2apsXsVw1cUj5+1MLyCKNBHZvo=@vger.kernel.org X-Gm-Message-State: AOJu0YxhEJGJzbyPiuhpU+ZAzTO7mHXPR0cHCUx4nE1LNcVPRBjP71bk 7U+KPa/oxqt7hYSH6Ev75AsPf4mwWKRYDWtDbOwi+H1/VGYj9ohgKVJlFZxJHgVVQg+BlNOq9SC ApaQFjnF+oJVWtYUOjaKceLG1Q0Gumd5RrKDaT56xs/0X+/JRftcc5PPKpuRxp4E15P8= X-Gm-Gg: AZuq6aImnzEZgBlPRbcuxeko6xEZ0JhXxtyxf1vAfvJkdPB7dnvdrXGW9dwrcFlr4py WKEKM3uW4ZOWC1FTybL8O8Pe/DGB4Gn56u02HzJDbp0oEAVkFanGzIxJuV2uMObiKMtboQK4Uqd ZnbzqxFb2XU2vLnNasSHsgy3QZhr5yUg2iW6MrF29cgw+Nu34EfAVJokZdjVsOIY9RjI5BeI3aj /kGgUi7E7//JNqIWB8TqPqe42rB3ev6RyTYCJhLraHSjaG6vFgJXus5+TOFphIA+XC77m2hyo6c 9Kg9/12CMxT1a0URGZY8pzpUMIQXN8u27KEiARdY/TMh8asTvgjLw51BlERIEro5Z4Hvsautl34 j3xoqDR31dqIxJlVSepn8bsQiKg5XnFTwq9Vv8Hd3JFk= X-Received: by 2002:a05:620a:440a:b0:8c6:b16c:a56 with SMTP id af79cd13be357-8ca40c5c033mr475106585a.38.1770311656772; Thu, 05 Feb 2026 09:14:16 -0800 (PST) X-Received: by 2002:a05:620a:440a:b0:8c6:b16c:a56 with SMTP id af79cd13be357-8ca40c5c033mr475100885a.38.1770311656230; Thu, 05 Feb 2026 09:14:16 -0800 (PST) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43618057f87sm14802849f8f.21.2026.02.05.09.14.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 09:14:15 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org Cc: lgirdwood@gmail.com, robh@kernel.org, krzk+dt@kernel.org, cnor+dt@kernel.org, srini@kernel.org, perex@perex.cz, tiwai@suse.com, alexey.klimov@linaro.org, mohammad.rafi.shaik@oss.qualcomm.com, quic_wcheng@quicinc.com, johan@kernel.org, dmitry.baryshkov@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla , Stable@vger.kernel.org Subject: [PATCH 01/10] ASoC: qcom: q6apm: fix array out of bounds on lpass ports Date: Thu, 5 Feb 2026 12:14:02 -0500 Message-ID: <20260205171411.34908-2-srinivas.kandagatla@oss.qualcomm.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260205171411.34908-1-srinivas.kandagatla@oss.qualcomm.com> References: <20260205171411.34908-1-srinivas.kandagatla@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjA1MDEzMCBTYWx0ZWRfXzbsnCeZyQPum IfLfhYtdI0einr1KBF7PAfp+K2Il2bZm+2VOQbZaZUMYD7HUNvFkUAhzvzcegUiAEtBNEWLOXeL 9f/qvtraY6hNg4e3GmTSTiuzJmitl4o2pb01+w2/XFHigb00rF1vWHc+PAnck+1i3SmDnfXHlFU tvR6Px2r6hON6jWQ7RyPGeeooId8llkrAEbMzyz7hF8fZewAeAZkSus8Z/8kSKghX0GP9zsnEMZ NQYhie4ja1QmGfQtvRyZPZauOfO+Mq0fAjFViP+KOyMu2h1L/7w9nHrp9Qx1pe8hl+h/lYF7IGq vo73no6fCt6r2acGCIynUJ5ZUpXJ7i6m39OV3El1ERhCO/97SQd/SVLLiUMtA382LCNUL14Uxt0 3eHVKiD51vHpZ0sIoFr+yKt0F5T6NG8QirsZpos2CdfoBqyMwEEO/rte9O1yoO7UJbJtt9WywBq lapBVe/RHmGu+Fzfxyw== X-Authority-Analysis: v=2.4 cv=GdcaXAXL c=1 sm=1 tr=0 ts=6984cfe9 cx=c_pps a=50t2pK5VMbmlHzFWWp8p/g==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=MyalSr31lt99Fa30PzAA:9 a=IoWCM6iH3mJn3m4BftBB:22 X-Proofpoint-ORIG-GUID: uxIuyHCaIK3LXGhP2k7gE3XlT1-AIQOu X-Proofpoint-GUID: uxIuyHCaIK3LXGhP2k7gE3XlT1-AIQOu X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-05_04,2026-02-05_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 bulkscore=0 phishscore=0 impostorscore=0 clxscore=1015 priorityscore=1501 spamscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602050130 Content-Type: text/plain; charset="utf-8" lpass ports numbers have been added but the apm driver never got updated with new max port value that it uses to store dai specific data. This will result in array out of bounds and weird driver behaviour. Fix this by adding a new LPASS_MAX_PORT which is can be used by driver instead of using number and any new port additional can only be done in one place, which should avoid these type of mistakes in future. Also update the driver to use this LPASS_MAX_PORT. Fixes: 55b5fb369c02 ("ASoC: dt-bindings: qcom,q6dsp-lpass-ports: Add USB_RX= port") Cc: Stable@vger.kernel.org Signed-off-by: Srinivas Kandagatla --- include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h | 1 + sound/soc/qcom/lpass.h | 2 +- sound/soc/qcom/qdsp6/q6afe.h | 3 ++- sound/soc/qcom/qdsp6/q6apm.h | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h b/include/d= t-bindings/sound/qcom,q6dsp-lpass-ports.h index 6d1ce7f5da51..609bc278f726 100644 --- a/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h +++ b/include/dt-bindings/sound/qcom,q6dsp-lpass-ports.h @@ -140,6 +140,7 @@ #define DISPLAY_PORT_RX_6 134 #define DISPLAY_PORT_RX_7 135 #define USB_RX 136 +#define LPASS_MAX_PORT (USB_RX + 1) =20 #define LPASS_CLK_ID_PRI_MI2S_IBIT 1 #define LPASS_CLK_ID_PRI_MI2S_EBIT 2 diff --git a/sound/soc/qcom/lpass.h b/sound/soc/qcom/lpass.h index de3ec6f594c1..99b0b6651fad 100644 --- a/sound/soc/qcom/lpass.h +++ b/sound/soc/qcom/lpass.h @@ -17,7 +17,7 @@ #include "lpass-hdmi.h" =20 #define LPASS_AHBIX_CLOCK_FREQUENCY 131072000 -#define LPASS_MAX_PORTS (DISPLAY_PORT_RX_7 + 1) +#define LPASS_MAX_PORTS (LPASS_MAX_PORT) #define LPASS_MAX_MI2S_PORTS (8) #define LPASS_MAX_DMA_CHANNELS (8) #define LPASS_MAX_HDMI_DMA_CHANNELS (4) diff --git a/sound/soc/qcom/qdsp6/q6afe.h b/sound/soc/qcom/qdsp6/q6afe.h index a29abe4ce436..ce4b04da1730 100644 --- a/sound/soc/qcom/qdsp6/q6afe.h +++ b/sound/soc/qcom/qdsp6/q6afe.h @@ -2,8 +2,9 @@ =20 #ifndef __Q6AFE_H__ #define __Q6AFE_H__ +#include =20 -#define AFE_PORT_MAX 137 +#define AFE_PORT_MAX LPASS_MAX_PORT =20 #define MSM_AFE_PORT_TYPE_RX 0 #define MSM_AFE_PORT_TYPE_TX 1 diff --git a/sound/soc/qcom/qdsp6/q6apm.h b/sound/soc/qcom/qdsp6/q6apm.h index 7ce08b401e31..189ed8a1a60d 100644 --- a/sound/soc/qcom/qdsp6/q6apm.h +++ b/sound/soc/qcom/qdsp6/q6apm.h @@ -16,7 +16,7 @@ #include #include "audioreach.h" =20 -#define APM_PORT_MAX 127 +#define APM_PORT_MAX LPASS_MAX_PORT #define APM_PORT_MAX_AUDIO_CHAN_CNT 8 #define PCM_CHANNEL_NULL 0 #define PCM_CHANNEL_FL 1 /* Front left channel. */ --=20 2.47.3