From: Chen-Yu Tsai <wenst@chromium.org>
To: Zhiyong Tao <zhiyong.tao@mediatek.com>
Cc: robh+dt@kernel.org, linus.walleij@linaro.org,
mark.rutland@arm.com, matthias.bgg@gmail.com,
sean.wang@kernel.org, srv_heupstream@mediatek.com,
hui.liu@mediatek.com, light.hsieh@mediatek.com,
sean.wang@mediatek.com, seiya.wang@mediatek.com,
rex-bc.chen@mediatek.com, guodong.liu@mediatek.com,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, linux-gpio@vger.kernel.org,
Guodong Liu <guodong.liu@mediatek.corp-partner.google.com>
Subject: Re: [PATCH v3] pinctrl: mediatek: fix global-out-of-bounds issue
Date: Wed, 10 Nov 2021 13:54:37 +0800 [thread overview]
Message-ID: <CAGXv+5Entn5QnCODgbUSdDFSds4z+_QJ6cD39yEoLndms+rY7Q@mail.gmail.com> (raw)
In-Reply-To: <20211110021411.31761-2-zhiyong.tao@mediatek.com>
On Wed, Nov 10, 2021 at 10:14 AM Zhiyong Tao <zhiyong.tao@mediatek.com> wrote:
>
> From: Guodong Liu <guodong.liu@mediatek.corp-partner.google.com>
>
> When eint virtual eint number is greater than gpio number,
> it maybe produce 'desc[eint_n]' size globle-out-of-bounds issue.
>
> Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
> Signed-off-by: Guodong Liu <guodong.liu@mediatek.corp-partner.google.com>
The order of Signed-off-by is still reversed though. The author comes first,
then comes everyone who subsequently handled the patch.
Once fixed,
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Also, for single patches, you don't really need to have a cover letter.
Any info you would convey through the cover letter, such as changelogs,
additional context, or whose tree you would like it merged through, can
be put after the triple-dash ...
> ---
here. Text put here won't get included in the commit log.
> drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
> index 45ebdeba985a..12163d3c4bcb 100644
> --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
> +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
> @@ -285,8 +285,12 @@ static int mtk_xt_get_gpio_n(void *data, unsigned long eint_n,
> desc = (const struct mtk_pin_desc *)hw->soc->pins;
> *gpio_chip = &hw->chip;
>
> - /* Be greedy to guess first gpio_n is equal to eint_n */
> - if (desc[eint_n].eint.eint_n == eint_n)
> + /*
> + * Be greedy to guess first gpio_n is equal to eint_n.
> + * Only eint virtual eint number is greater than gpio number.
> + */
> + if (hw->soc->npins > eint_n &&
> + desc[eint_n].eint.eint_n == eint_n)
> *gpio_n = eint_n;
> else
> *gpio_n = mtk_xt_find_eint_num(hw, eint_n);
> --
> 2.25.1
>
>
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek
prev parent reply other threads:[~2021-11-10 5:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-10 2:14 [PATCH v3 0/1] Mediatek pinctrl patch Zhiyong Tao
2021-11-10 2:14 ` [PATCH v3] pinctrl: mediatek: fix global-out-of-bounds issue Zhiyong Tao
2021-11-10 5:54 ` Chen-Yu Tsai [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=CAGXv+5Entn5QnCODgbUSdDFSds4z+_QJ6cD39yEoLndms+rY7Q@mail.gmail.com \
--to=wenst@chromium.org \
--cc=devicetree@vger.kernel.org \
--cc=guodong.liu@mediatek.com \
--cc=guodong.liu@mediatek.corp-partner.google.com \
--cc=hui.liu@mediatek.com \
--cc=light.hsieh@mediatek.com \
--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=linux-mediatek@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=matthias.bgg@gmail.com \
--cc=rex-bc.chen@mediatek.com \
--cc=robh+dt@kernel.org \
--cc=sean.wang@kernel.org \
--cc=sean.wang@mediatek.com \
--cc=seiya.wang@mediatek.com \
--cc=srv_heupstream@mediatek.com \
--cc=zhiyong.tao@mediatek.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;
as well as URLs for NNTP newsgroup(s).