diff options
author | Dan Williams <dan.j.williams@intel.com> | 2023-10-04 18:35:01 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2023-10-06 00:12:45 -0700 |
commit | 339818380868e34ff2c482db05031bf47a67d609 (patch) | |
tree | 077496106030918f8389fc97c6cd4cb58824a1ab /fs/xfs/xfs_log.c | |
parent | 5f2da19714465739da2449253b13ac06cb353a26 (diff) | |
download | linux-339818380868e34ff2c482db05031bf47a67d609.tar.gz linux-339818380868e34ff2c482db05031bf47a67d609.tar.bz2 linux-339818380868e34ff2c482db05031bf47a67d609.zip |
cxl/memdev: Fix sanitize vs decoder setup locking
The sanitize operation is destructive and the expectation is that the
device is unmapped while in progress. The current implementation does a
lockless check for decoders being active, but then does nothing to
prevent decoders from racing to be committed. Introduce state tracking
to resolve this race.
This incidentally cleans up unpriveleged userspace from triggering mmio
read cycles by spinning on reading the 'security/state' attribute. Which
at a minimum is a waste since the kernel state machine can cache the
completion result.
Lastly cxl_mem_sanitize() was mistakenly marked EXPORT_SYMBOL() in the
original implementation, but an export was never required.
Fixes: 0c36b6ad436a ("cxl/mbox: Add sanitization handling machinery")
Cc: Davidlohr Bueso <dave@stgolabs.net>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'fs/xfs/xfs_log.c')
0 files changed, 0 insertions, 0 deletions