From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Konrad Dybcio <konrad.dybcio@linaro.org>,
Andy Gross <agross@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Vinod Koul <vkoul@kernel.org>,
Bard Liao <yung-chuan.liao@linux.intel.com>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
Sanyog Kale <sanyog.r.kale@intel.com>,
linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] soundwire: qcom: gracefully handle too many ports in DT
Date: Wed, 22 Feb 2023 15:50:30 +0100 [thread overview]
Message-ID: <80339c7f-1cea-3c97-7dc4-5efb4597cb69@linaro.org> (raw)
In-Reply-To: <dc544641-b9f1-96b4-95a1-30fafc0712e5@linaro.org>
On 22/02/2023 15:47, Konrad Dybcio wrote:
>
>
> On 22.02.2023 15:44, Krzysztof Kozlowski wrote:
>> There are two issues related to the number of ports coming from
>> Devicetree when exceeding in total QCOM_SDW_MAX_PORTS. Both lead to
>> incorrect memory accesses:
>> 1. With DTS having too big value of input or output ports, the driver,
>> when copying port parameters from local/stack arrays into 'pconfig'
>> array in 'struct qcom_swrm_ctrl', will iterate over their sizes.
>>
>> 2. If DTS also has too many parameters for these ports (e.g.
>> qcom,ports-sinterval-low), the driver will overflow buffers on the
>> stack when reading these properties from DTS.
>>
>> Add a sanity check so incorrect DTS will not cause kernel memory
>> corruption.
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> ---
> Fixes: 02efb49aa805 ("soundwire: qcom: add support for SoundWire controller")
Can be... but is it really a bug of the kernel? Issue is visible with
incorrect DTS and it's not the kernel's job to fix it. If DTS has
incorrect values (e.g. IO addresses) system won't work anyway and that's
the same type of bug.
Best regards,
Krzysztof
next prev parent reply other threads:[~2023-02-22 14:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-22 14:44 [PATCH 1/2] soundwire: qcom: define hardcoded version magic numbers Krzysztof Kozlowski
2023-02-22 14:44 ` [PATCH 2/2] soundwire: qcom: gracefully handle too many ports in DT Krzysztof Kozlowski
2023-02-22 14:47 ` Konrad Dybcio
2023-02-22 14:50 ` Krzysztof Kozlowski [this message]
2023-02-22 14:53 ` Konrad Dybcio
2023-03-15 13:55 ` Srinivas Kandagatla
2023-02-22 14:45 ` [PATCH 1/2] soundwire: qcom: define hardcoded version magic numbers Konrad Dybcio
2023-03-15 13:55 ` Srinivas Kandagatla
2023-03-15 14:13 ` Vinod Koul
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=80339c7f-1cea-3c97-7dc4-5efb4597cb69@linaro.org \
--to=krzysztof.kozlowski@linaro.org \
--cc=agross@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=andersson@kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=sanyog.r.kale@intel.com \
--cc=vkoul@kernel.org \
--cc=yung-chuan.liao@linux.intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox