lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YaZ3yiIBRj6qIg2h@agluck-desk2.amr.corp.intel.com>
Date:   Tue, 30 Nov 2021 11:13:14 -0800
From:   "Luck, Tony" <tony.luck@...el.com>
To:     Shuai Xue <xueshuai@...ux.alibaba.com>
Cc:     mchehab@...nel.org, bp@...en8.de, james.morse@....com,
        rric@...nel.org, linux-edac@...r.kernel.org,
        linux-kernel@...r.kernel.org, zhangliguang@...ux.alibaba.com,
        zhuo.song@...ux.alibaba.com
Subject: Re: [PATCH] edac,ghes,cper: Add device to Memory Error Record

On Tue, Nov 30, 2021 at 09:16:48PM +0800, Shuai Xue wrote:
> If Bit 7 of Validation Bits is valid, the device number of the memory
> associated with errors should be reported to Memory Error Record.
> 
> Signed-off-by: Shuai Xue <xueshuai@...ux.alibaba.com>
> ---
>  drivers/edac/ghes_edac.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/edac/ghes_edac.c b/drivers/edac/ghes_edac.c
> index a918ca93e4f7..cf98b270d6f7 100644
> --- a/drivers/edac/ghes_edac.c
> +++ b/drivers/edac/ghes_edac.c
> @@ -378,6 +378,8 @@ void ghes_edac_report_mem_error(int sev, struct cper_sec_mem_err *mem_err)
>  	if (mem_err->validation_bits & CPER_MEM_VALID_BANK_ADDRESS)
>  		p += sprintf(p, "bank_address:%d ",
>  			     mem_err->bank & CPER_MEM_BANK_ADDRESS_MASK);
> +	if (mem_err->validation_bits & CPER_MEM_VALID_DEVICE)
> +		p += sprintf(p, "device:%d ", mem_err->device);
>  	if (mem_err->validation_bits & (CPER_MEM_VALID_ROW | CPER_MEM_VALID_ROW_EXT)) {
>  		u32 row = mem_err->row;
>  

This looks OK (same as code in drivers/firmware/efi/cper.c in the
cper_mem_err_location() function. But that makes me wonder why there
is near duplication of code in ghes_edac.c?

The cper.c code seems to be written defensively using scnprintf()
instead of sprintf().  Could ghes_edac share the same code?

-Tony

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ