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] [day] [month] [year] [list]
Message-ID: <CAPcyv4j7+d-jb+SP6QPJksK68jx8zqyd=MfpXeE84_RXkRqugQ@mail.gmail.com>
Date:   Mon, 20 Mar 2017 10:55:30 -0700
From:   Dan Williams <dan.j.williams@...el.com>
To:     Ben Hutchings <ben@...adent.org.uk>
Cc:     "stable@...r.kernel.org" <stable@...r.kernel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Nicholas Moulin <nicholas.w.moulin@...ux.intel.com>
Subject: Re: [PATCH 4.4 33/35] nfit, libnvdimm: fix interleave set cookie calculation

On Sun, Mar 19, 2017 at 9:38 AM, Ben Hutchings <ben@...adent.org.uk> wrote:
> On Thu, 2017-03-16 at 23:29 +0900, Greg Kroah-Hartman wrote:
>> 4.4-stable review patch.  If anyone has any objections, please let me know.
>>
>> ------------------
>>
>> From: Dan Williams <dan.j.williams@...el.com>
>>
>> commit 86ef58a4e35e8fa66afb5898cf6dec6a3bb29f67 upstream.
>>
>> The interleave-set cookie is a sum that sanity checks the composition of
>> an interleave set has not changed from when the namespace was initially
>> created.  The checksum is calculated by sorting the DIMMs by their
>> location in the interleave-set. The comparison for the sort must be
>> 64-bit wide, not byte-by-byte as performed by memcmp() in the broken
>> case.
> [...]
>> --- a/drivers/acpi/nfit.c
>> +++ b/drivers/acpi/nfit.c
> [...]
>> +static int cmp_map(const void *m0, const void *m1)
>> +{
>> +     const struct nfit_set_info_map *map0 = m0;
>> +     const struct nfit_set_info_map *map1 = m1;
>> +
>> +     return map0->region_offset - map1->region_offset;
>> +}
> [...]
>
> This is returning an int, thus it's effectively doing a 32-bit
> comparison and not the 64-bit comparison you say is needed.
>
> I think this function needs to do something like:
>
>         return (map0->region_offset < map1->region_offset) ? -1 :
>                 (map0->region_offset == map1->region_offset) ? 0 : 1;

Yes, you're right. We could end up with unexpected sign changes. Good catch.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ