From mboxrd@z Thu Jan 1 00:00:00 1970 From: Borislav Petkov Subject: Re: [PATCH v8 18/26] ACPI / APEI: Make GHES estatus header validation more user friendly Date: Fri, 1 Feb 2019 15:30:40 +0100 Message-ID: <20190201143040.GJ31854@zn.tnic> References: <20190129184902.102850-1-james.morse@arm.com> <20190129184902.102850-19-james.morse@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20190129184902.102850-19-james.morse@arm.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu To: James Morse Cc: Rafael Wysocki , Tony Luck , linux-mm@kvack.org, Marc Zyngier , Catalin Marinas , Will Deacon , Dongjiu Geng , linux-acpi@vger.kernel.org, Naoya Horiguchi , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, Len Brown List-Id: linux-acpi@vger.kernel.org On Tue, Jan 29, 2019 at 06:48:54PM +0000, James Morse wrote: > ghes_read_estatus() checks various lengths in the top-level header to > ensure the CPER records to be read aren't obviously corrupt. > > Take the opportunity to make this more user-friendly, printing a > (ratelimited) message about the nature of the header format error. > > Suggested-by: Borislav Petkov > Signed-off-by: James Morse > --- > drivers/acpi/apei/ghes.c | 46 ++++++++++++++++++++++++++++------------ > 1 file changed, 32 insertions(+), 14 deletions(-) > > diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c > index f95db2398dd5..9391fff71344 100644 > --- a/drivers/acpi/apei/ghes.c > +++ b/drivers/acpi/apei/ghes.c > @@ -293,6 +293,30 @@ static void ghes_copy_tofrom_phys(void *buffer, u64 paddr, u32 len, > } > } > > +/* Check the top-level record header has an appropriate size. */ > +int __ghes_check_estatus(struct ghes *ghes, static. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.