public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Hanjun Guo <guohanjun@huawei.com>
To: Zheng Zengkai <zhengzengkai@huawei.com>, <lpieralisi@kernel.org>,
	<sudeep.holla@arm.com>, <mark.rutland@arm.com>, <maz@kernel.org>,
	<rafael@kernel.org>, <lenb@kernel.org>
Cc: <daniel.lezcano@linaro.org>, <tglx@linutronix.de>,
	<linux-acpi@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4] ACPI: GTDT: Tighten the check for the array of platform timer structures
Date: Sat, 19 Oct 2024 14:41:15 +0800	[thread overview]
Message-ID: <c1b7159e-3bd1-ff2d-da94-fcf5a48220d2@huawei.com> (raw)
In-Reply-To: <20241016095458.34126-1-zhengzengkai@huawei.com>

On 2024/10/16 17:54, Zheng Zengkai wrote:
> As suggested by Marc and Lorenzo, first we need to check whether the
> platform_timer entry pointer is within gtdt bounds (< gtdt_end) before
> de-referencing what it points at to detect the length of the platform
> timer struct and then check that the length of current platform_timer
> struct is also valid, i.e. the length is not zero and within gtdt_end.
> Now next_platform_timer() only checks against gtdt_end for the entry of
> subsequent platform timer without checking the length of it and will
> not report error if the check failed and the existing check in function
> acpi_gtdt_init() is also not enough.
> 
> Modify the for_each_platform_timer() iterator and use it combined with
> a dedicated check function platform_timer_valid() to do the check
> against table length (gtdt_end) for each element of platform timer
> array in function acpi_gtdt_init(), making sure that both their entry
> and length actually fit in the table.
> 
> Suggested-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
> Co-developed-by: Marc Zyngier <maz@kernel.org>
> Signed-off-by: Marc Zyngier <maz@kernel.org>

Nit: since there is a "Co-developed-by:" for Marc, the
"Signed-off-by:" can be removed. The rest of the patch looks
good to me.

I did a test again Kunpeng ARM sever and no regressions,
hopefully will not trigger firmware bugs for other
platforms.

Reviewed-by: Hanjun Guo <guohanjun@huawei.com>
Tested-by: Hanjun Guo <guohanjun@huawei.com>

Thanks
Hanjun


  parent reply	other threads:[~2024-10-19  6:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-16  9:54 [PATCH v4] ACPI: GTDT: Tighten the check for the array of platform timer structures Zheng Zengkai
2024-10-16 10:01 ` Lorenzo Pieralisi
2024-10-29 14:16   ` Zheng Zengkai
2024-10-30  9:49     ` Lorenzo Pieralisi
2024-10-19  6:41 ` Hanjun Guo [this message]
2024-10-19  7:35   ` Hanjun Guo
2024-11-04 17:10 ` Catalin Marinas

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=c1b7159e-3bd1-ff2d-da94-fcf5a48220d2@huawei.com \
    --to=guohanjun@huawei.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=rafael@kernel.org \
    --cc=sudeep.holla@arm.com \
    --cc=tglx@linutronix.de \
    --cc=zhengzengkai@huawei.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