]> xenbits.xensource.com Git - xen.git/commit
rwlock: introduce support for blocking speculation into critical regions
authorRoger Pau Monné <roger.pau@citrix.com>
Tue, 13 Feb 2024 15:08:52 +0000 (16:08 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 12 Mar 2024 16:37:45 +0000 (16:37 +0000)
commit05b47a40c0e1522e9d7f52969c5936e39e163fb6
tree687e06abbc0a98eb4eb6708c45fc651ef895c922
parent1b2cc8f9c09696b34d9d985525afa8010a8daa90
rwlock: introduce support for blocking speculation into critical regions

Introduce inline wrappers as required and add direct calls to
block_lock_speculation() in order to prevent speculation into the rwlock
protected critical regions.

Note the rwlock primitives are adjusted to use the non speculation safe variants
of the spinlock handlers, as a speculation barrier is added in the rwlock
calling wrappers.

trylock variants are protected by using lock_evaluate_nospec().

This is part of XSA-453 / CVE-2024-2193

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
(cherry picked from commit a1fb15f61692b1fa9945fc51f55471ace49cdd59)
xen/common/rwlock.c
xen/include/xen/rwlock.h