* Patch "acpi, nfit, libnvdimm: fix interleave set cookie calculation (64-bit comparison)" has been added to the 4.10-stable tree
@ 2017-04-18 14:00 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-04-18 14:00 UTC (permalink / raw)
To: dan.j.williams, ben, gregkh, nicholas.w.moulin; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
acpi, nfit, libnvdimm: fix interleave set cookie calculation (64-bit comparison)
to the 4.10-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
acpi-nfit-libnvdimm-fix-interleave-set-cookie-calculation-64-bit-comparison.patch
and it can be found in the queue-4.10 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From b03b99a329a14b7302f37c3ea6da3848db41c8c5 Mon Sep 17 00:00:00 2001
From: Dan Williams <dan.j.williams@intel.com>
Date: Mon, 27 Mar 2017 21:53:38 -0700
Subject: acpi, nfit, libnvdimm: fix interleave set cookie calculation (64-bit comparison)
From: Dan Williams <dan.j.williams@intel.com>
commit b03b99a329a14b7302f37c3ea6da3848db41c8c5 upstream.
While reviewing the -stable patch for commit 86ef58a4e35e "nfit,
libnvdimm: fix interleave set cookie calculation" Ben noted:
"This is returning an int, thus it's effectively doing a 32-bit
comparison and not the 64-bit comparison you say is needed."
Update the compare operation to be immune to this integer demotion problem.
Cc: Nicholas Moulin <nicholas.w.moulin@linux.intel.com>
Fixes: 86ef58a4e35e ("nfit, libnvdimm: fix interleave set cookie calculation")
Reported-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/acpi/nfit/core.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -1617,7 +1617,11 @@ static int cmp_map(const void *m0, const
const struct nfit_set_info_map *map0 = m0;
const struct nfit_set_info_map *map1 = m1;
- return map0->region_offset - map1->region_offset;
+ if (map0->region_offset < map1->region_offset)
+ return -1;
+ else if (map0->region_offset > map1->region_offset)
+ return 1;
+ return 0;
}
/* Retrieve the nth entry referencing this spa */
Patches currently in stable-queue which might be from dan.j.williams@intel.com are
queue-4.10/libnvdimm-band-aid-btt-vs-clear-poison-locking.patch
queue-4.10/acpi-nfit-libnvdimm-fix-interleave-set-cookie-calculation-64-bit-comparison.patch
queue-4.10/libnvdimm-fix-blk-free-space-accounting.patch
queue-4.10/x86-pmem-fix-broken-__copy_user_nocache-cache-bypass-assumptions.patch
queue-4.10/libnvdimm-fix-reconfig_mutex-mmap_sem-and-jbd2_handle-lockdep-splat.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-04-18 14:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-18 14:00 Patch "acpi, nfit, libnvdimm: fix interleave set cookie calculation (64-bit comparison)" has been added to the 4.10-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).