[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <efa65048-e176-4bad-aac8-0147d26b1362@amd.com>
Date: Tue, 9 Jul 2024 01:29:13 -0500
From: "Naik, Avadhut" <avadnaik@....com>
To: Borislav Petkov <bp@...en8.de>
Cc: Avadhut Naik <avadhut.naik@....com>, x86@...nel.org,
linux-edac@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
tony.luck@...el.com, rafael@...nel.org, tglx@...utronix.de,
mingo@...hat.com, rostedt@...dmis.org, lenb@...nel.org, mchehab@...nel.org,
james.morse@....com, airlied@...il.com, yazen.ghannam@....com,
john.allen@....com
Subject: Re: [PATCH v2 4/4] EDAC/mce_amd: Add support for FRU Text in MCA
On 6/26/2024 13:20, Borislav Petkov wrote:
> On Wed, Jun 26, 2024 at 01:00:30PM -0500, Naik, Avadhut wrote:
>>>
>>> Why are you clearing it if you're overwriting it immediately?
>>>
>> Since its a local variable, wanted to ensure that the memory is zeroed out to prevent
>> any issues with the %s specifier, used later on.
>
> What issues?
>
Its a locally defined string of 17 bytes. We are doing memcpy() into the first 16 bytes.
Don't we need to ensure that it is NULL-terminated to prevent undefined behavior when its
given to pr_emerg()? Am I missing something here?
>> Would you recommend removing that and using initializer instead for the string?
>
> I'd recommend looking at what the code does and then really thinking whether
> that makes any sense.
>
--
Thanks,
Avadhut Naik
Powered by blists - more mailing lists