From: Maxime Ripard <maxime@cerno.tech>
To: Liu Xiang <liu.xiang@zlingsmart.com>
Cc: jernej.skrabec@siol.net, liuxiang_1999@126.com,
linus.walleij@linaro.org, linux-kernel@vger.kernel.org,
linux-gpio@vger.kernel.org, wens@csie.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] pinctrl: sunxi: fix use-after-free in sunxi_pmx_free()
Date: Thu, 21 Jan 2021 17:40:13 +0100 [thread overview]
Message-ID: <20210121164013.cqfxvach4ugkohm7@gilmour> (raw)
In-Reply-To: <20210119062908.20169-1-liu.xiang@zlingsmart.com>
[-- Attachment #1.1: Type: text/plain, Size: 600 bytes --]
Hi,
On Tue, Jan 19, 2021 at 02:29:08PM +0800, Liu Xiang wrote:
> When CONFIG_REGULATOR is not set, sunxi_pmx_request() always return
> success. Even a group of pins call sunxi_pmx_request(), the refcount
> is only 1. This can cause a use-after-free warning in sunxi_pmx_free().
> To solve this problem, go to err path if regulator_get() return NULL
> or error.
>
> Signed-off-by: Liu Xiang <liu.xiang@zlingsmart.com>
Is there any drawback to depending on CONFIG_REGULATOR?
Given that we need those regulators enabled anyway, I guess we could
just select or depends on it
Maxime
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-01-21 16:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-19 6:29 [PATCH] pinctrl: sunxi: fix use-after-free in sunxi_pmx_free() Liu Xiang
2021-01-21 16:40 ` Maxime Ripard [this message]
2021-01-22 22:53 ` Linus Walleij
[not found] ` <5c4b7a8c-c549-43ae-8ec6-5ae3ed26d321.liu.xiang@zlingsmart.com>
2021-01-26 15:03 ` Linus Walleij
2021-01-26 15:24 ` Maxime Ripard
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=20210121164013.cqfxvach4ugkohm7@gilmour \
--to=maxime@cerno.tech \
--cc=jernej.skrabec@siol.net \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liu.xiang@zlingsmart.com \
--cc=liuxiang_1999@126.com \
--cc=wens@csie.org \
/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