public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Alessandro Carminati (Red Hat) <alessandro.carminati@gmail.com>,
	linux-clk@vger.kernel.org
Cc: Alessandro Carminati <alessandro.carminati@gmail.com>,
	linux-kernel@vger.kernel.org,
	Michael Turquette <mturquette@baylibre.com>,
	Philip Daly <pdaly@redhat.com>
Subject: Re: [PATCH v2] clk: Sanitize possible_parent_show to Handle Return Value of of_clk_get_parent_name
Date: Thu, 12 Oct 2023 16:21:54 -0700	[thread overview]
Message-ID: <2350c4a3e6c2ed214dd232abc73b2074.sboyd@kernel.org> (raw)
In-Reply-To: <20230921073217.572151-1-alessandro.carminati@gmail.com>

Quoting Alessandro Carminati (Red Hat) (2023-09-21 00:32:17)
> From: Alessandro Carminati <alessandro.carminati@gmail.com>
> 
> In the possible_parent_show function, ensure proper handling of the return
> value from of_clk_get_parent_name to prevent potential issues arising from
> a NULL return.
> The current implementation invokes seq_puts directly on the result of
> of_clk_get_parent_name without verifying the return value, which can lead
> to kernel panic if the function returns NULL.
> 
> This patch addresses the concern by introducing a check on the return
> value of of_clk_get_parent_name. If the return value is not NULL, the
> function proceeds to call seq_puts, providing the returned value as
> argument.
> However, if of_clk_get_parent_name returns NULL, the function provides a
> static string as argument, avoiding the panic.
> 
> Fixes: 1ccc0ddf046a ("clk: Use seq_puts() in possible_parent_show()")
> Reported-by: Philip Daly <pdaly@redhat.com>
> Signed-off-by: Alessandro Carminati (Red Hat) <alessandro.carminati@gmail.com>
> ---

Applied to clk-fixes

      parent reply	other threads:[~2023-10-12 23:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-21  7:32 [PATCH v2] clk: Sanitize possible_parent_show to Handle Return Value of of_clk_get_parent_name Alessandro Carminati (Red Hat)
2023-10-04  8:38 ` Alessandro Carminati
2023-10-12 23:21 ` Stephen Boyd [this message]

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=2350c4a3e6c2ed214dd232abc73b2074.sboyd@kernel.org \
    --to=sboyd@kernel.org \
    --cc=alessandro.carminati@gmail.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=pdaly@redhat.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