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: <97eb67fe-b60c-3291-3743-3e3655a0bb27@oracle.com>
Date:   Mon, 1 Aug 2022 20:31:19 +0000
From:   Jane Chu <jane.chu@...cle.com>
To:     "Luck, Tony" <tony.luck@...el.com>, "bp@...en8.de" <bp@...en8.de>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
        "x86@...nel.org" <x86@...nel.org>,
        "linux-edac@...r.kernel.org" <linux-edac@...r.kernel.org>,
        "Williams, Dan J" <dan.j.williams@...el.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "hch@....de" <hch@....de>,
        "nvdimm@...ts.linux.dev" <nvdimm@...ts.linux.dev>
Subject: Re: [PATCH v5] x86/mce: retrieve poison range from hardware

On 8/1/2022 8:58 AM, Luck, Tony wrote:
>> 	struct mce m;
>> +	int lsb = PAGE_SHIFT;
> 
> Some maintainers like to order local declaration lines from longest to shortest
>   
>> +     /*
>> +      * Even if the ->validation_bits are set for address mask,
>> +      * to be extra safe, check and reject an error radius '0',
>> +      * and fallback to the default page size.
>> +      */
>> +     if (mem_err->validation_bits & CPER_MEM_VALID_PA_MASK) {
>> +             lsb = __ffs64(mem_err->physical_addr_mask);
>> +             if (lsb == 1)
>> +                     lsb = PAGE_SHIFT;
>> +     }
> 
> 
> The comment above __ffs64() says:
> 
> * The result is not defined if no bits are set, so check that @word
>   * is non-zero before calling this.
> 
> So if the intent is "extra safe" should check for that:
> 
>          if (mem_err->validation_bits & CPER_MEM_VALID_PA_MASK &&
>              mem_err->physical_addr_mask) {
>                  lsb = __ffs64(mem_err->physical_addr_mask);
>                  if (lsb == 1)
>                          lsb = PAGE_SHIFT;
>          }

Indeed, thanks a lot!

-jane


> 
> -Tony
> 
> 	
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ