All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@linaro.org>
To: Mukesh Ojha <quic_mojha@quicinc.com>, andersson@kernel.org
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linus.walleij@linaro.org, linux-gpio@vger.kernel.org
Subject: Re: [PATCH v12 8/9] firmware: qcom: scm: Add check to prevent Null pointer dereference
Date: Sat, 2 Mar 2024 00:42:26 +0100	[thread overview]
Message-ID: <77485a55-c9da-408f-8dcc-77c6734927da@linaro.org> (raw)
In-Reply-To: <20240227155308.18395-9-quic_mojha@quicinc.com>

On 27.02.2024 16:53, Mukesh Ojha wrote:
> There are multiple place in SCM driver __scm->dev is being
> accessed without checking if it is valid or not and all
> not all of function needs the device but it is needed
> for some cases when the number of argument passed is more
> and dma_map_single () api is used.
> 
> Add a NULL check for the cases when it is fine even to pass
> device as NULL and add qcom_scm_is_available() check for
> cases when it is needed for DMA api's.
> 
> Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
> ---

Most (all?) drivers calling into SCM already check is_available()
at probe time. I'm not sure returning -EPROBE_DEFER would be good
for calls outside .probe.

Konrad

  parent reply	other threads:[~2024-03-01 23:42 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-27 15:52 [PATCH v12 0/9] Misc SCM driver changes Mukesh Ojha
2024-02-27 15:53 ` [PATCH v12 1/9] firmware: qcom: scm: Rename scm_query_lock to scm_lock Mukesh Ojha
2024-03-02 19:10   ` Bjorn Andersson
2024-02-27 15:53 ` [PATCH v12 2/9] firmware: qcom: scm: provide a read-modify-write function Mukesh Ojha
2024-03-02 19:09   ` Bjorn Andersson
2024-03-05 10:39     ` Mukesh Ojha
2024-02-27 15:53 ` [PATCH v12 3/9] firmware: qcom: scm: Modify only the download bits in TCSR register Mukesh Ojha
2024-03-02 19:13   ` Bjorn Andersson
2024-03-05 10:43     ` Mukesh Ojha
2024-02-27 15:53 ` [PATCH v12 4/9] firmware: qcom: scm: Rework dload mode availability check Mukesh Ojha
2024-03-02 19:16   ` Bjorn Andersson
2024-03-05 10:54     ` Mukesh Ojha
2024-02-27 15:53 ` [PATCH v12 5/9] pinctrl: qcom: Use qcom_scm_io_rmw() function Mukesh Ojha
2024-02-29 13:56   ` Linus Walleij
2024-02-27 15:53 ` [PATCH v12 6/9] firmware: qcom: scm: Remove log reporting memory allocation failure Mukesh Ojha
2024-03-02 19:18   ` Bjorn Andersson
2024-02-27 15:53 ` [PATCH v12 7/9] firmware: qcom: scm: Fix __scm->dev assignement Mukesh Ojha
2024-03-02 19:25   ` Bjorn Andersson
2024-03-18 13:08     ` Mukesh Ojha
2024-03-19  1:17       ` Pavan Kondeti
2024-03-19 10:08         ` Mukesh Ojha
2024-03-19 10:22           ` Pavan Kondeti
2024-03-19 14:39             ` Mukesh Ojha
2024-02-27 15:53 ` [PATCH v12 8/9] firmware: qcom: scm: Add check to prevent Null pointer dereference Mukesh Ojha
2024-02-27 16:56   ` Elliot Berman
2024-02-28 15:08     ` Mukesh Ojha
2024-03-01 23:42   ` Konrad Dybcio [this message]
2024-03-02 18:57   ` Bjorn Andersson
2024-02-27 15:53 ` [PATCH v12 9/9] firmware: scm: Remove redundant scm argument from qcom_scm_waitq_wakeup() Mukesh Ojha
2024-03-02 19:23   ` Bjorn Andersson

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=77485a55-c9da-408f-8dcc-77c6734927da@linaro.org \
    --to=konrad.dybcio@linaro.org \
    --cc=andersson@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quic_mojha@quicinc.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 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.