From: Stephen Boyd <sboyd@kernel.org>
To: Conor Dooley <conor@kernel.org>
Cc: Michael Turquette <mturquette@baylibre.com>,
linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org,
patches@lists.linux.dev, Tommaso Merciai <tomm.merciai@gmail.com>,
Emil Renner Berthing <emil.renner.berthing@canonical.com>,
Hal Feng <hal.feng@starfivetech.com>,
Conor Dooley <conor.dooley@microchip.com>,
Xingyu Wu <xingyu.wu@starfivetech.com>
Subject: Re: [PATCH] clk: starfive: Avoid casting iomem pointers
Date: Thu, 13 Apr 2023 15:01:02 -0700 [thread overview]
Message-ID: <558d22a8848f2f026f272fdc0528424d.sboyd@kernel.org> (raw)
In-Reply-To: <20230413-creamer-overstate-f7ce5a72e437@spud>
Quoting Conor Dooley (2023-04-13 14:26:56)
> > @@ -335,26 +338,32 @@ static void jh7110_reset_unregister_adev(void *_adev)
> > struct auxiliary_device *adev = _adev;
> >
> > auxiliary_device_delete(adev);
> > + auxiliary_device_uninit(adev);
>
> Huh, I think you didn't explicitly mention this one, but it's actually
> part of the UAF fix AFAICT?
>
> When I did the aux device stuff for the clk-mpfs driver, I copied from
> peci as there were almost no examples of aux dev stuff in-tree.
> It looks like subsequently to me starting development, this fix landed:
> 1c11289b34ab ("peci: cpu: Fix use-after-free in adev_release()")
>
> It similarly moves the uninit() to the release callback...
>
> I think I need the below (whitespace damaged):
Yeah that looks better. Care to send a proper patch for it?
> diff --git a/drivers/clk/microchip/clk-mpfs.c b/drivers/clk/microchip/clk-mpfs.c
> index 4f0a19db7ed7..cc5d7dee59f0 100644
> --- a/drivers/clk/microchip/clk-mpfs.c
> +++ b/drivers/clk/microchip/clk-mpfs.c
> @@ -374,14 +374,13 @@ static void mpfs_reset_unregister_adev(void *_adev)
> struct auxiliary_device *adev = _adev;
>
> auxiliary_device_delete(adev);
> + auxiliary_device_uninit(adev);
> }
>
> static void mpfs_reset_adev_release(struct device *dev)
> {
> struct auxiliary_device *adev = to_auxiliary_dev(dev);
>
> - auxiliary_device_uninit(adev);
> -
> kfree(adev);
> }
>
> Anyways, for this patch:
> Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
>
Thanks.
next prev parent reply other threads:[~2023-04-13 22:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-13 20:55 [PATCH] clk: starfive: Avoid casting iomem pointers Stephen Boyd
2023-04-13 21:26 ` Conor Dooley
2023-04-13 22:01 ` Stephen Boyd [this message]
2023-04-13 22:22 ` Conor Dooley
2023-04-13 22:48 ` Stephen Boyd
2023-04-14 1:58 ` Xingyu Wu
2023-04-14 23:31 ` Hal Feng
2023-04-18 0:30 ` Stephen Boyd
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=558d22a8848f2f026f272fdc0528424d.sboyd@kernel.org \
--to=sboyd@kernel.org \
--cc=conor.dooley@microchip.com \
--cc=conor@kernel.org \
--cc=emil.renner.berthing@canonical.com \
--cc=hal.feng@starfivetech.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=patches@lists.linux.dev \
--cc=tomm.merciai@gmail.com \
--cc=xingyu.wu@starfivetech.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