summaryrefslogtreecommitdiffstats
path: root/lib/decompress_inflate.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2023-10-04 18:35:01 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-11-20 11:59:30 +0100
commitd1d13a0934227eb09ff60607f9ceb6449994aeca (patch)
tree49c514ce301a83cf9dcf44bf9d8980d1b14ff881 /lib/decompress_inflate.c
parentd4e21e7b942099f7730e6101ca9a7d0fa207fb79 (diff)
downloadlinux-stable-d1d13a0934227eb09ff60607f9ceb6449994aeca.tar.gz
linux-stable-d1d13a0934227eb09ff60607f9ceb6449994aeca.tar.bz2
linux-stable-d1d13a0934227eb09ff60607f9ceb6449994aeca.zip
cxl/memdev: Fix sanitize vs decoder setup locking
[ Upstream commit 339818380868e34ff2c482db05031bf47a67d609 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'lib/decompress_inflate.c')
0 files changed, 0 insertions, 0 deletions