mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
x86/mem-sharing: ensure consistent lock order in get_two_gfns()
While the comment validly says "Sort by domain, if same domain by gfn",
the implementation also included equal domain IDs in the first part of
the check, thus rending the second part entirely dead and leaving
deadlock potential when there's only a single domain involved.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
master commit: 09af2d01a2
master date: 2021-07-07 12:35:12 +0200
This commit is contained in:
1 parent
1ed3661879
commit
3cfccd7099
1 file changed
+1
-1
@@ -552,7 +552,7 @@ do { \
|
||||
dest ## _t = (source ## t) ?: &scratch_t; \
|
||||
} while (0)
|
||||
|
||||
if ( (rd->domain_id <= ld->domain_id) ||
|
||||
if ( (rd->domain_id < ld->domain_id) ||
|
||||
((rd == ld) && (gfn_x(rgfn) <= gfn_x(lgfn))) )
|
||||
{
|
||||
assign_pointers(first, r);
|
||||
|
||||