diff options
author | Li Lingfeng <lilingfeng3@huawei.com> | 2023-06-06 20:20:24 +0800 |
---|---|---|
committer | Mike Snitzer <snitzer@kernel.org> | 2023-06-15 12:46:59 -0400 |
commit | cb65b282c9640c27d3129e2e04b711ce1b352838 (patch) | |
tree | 9e34492544e5ed5260099fb6fd3c8a3b14a22705 /drivers/dax/cxl.c | |
parent | 2760904d895279f87196f0fa9ec570c79fe6a2e4 (diff) |
dm thin metadata: check fail_io before using data_sm
Must check pmd->fail_io before using pmd->data_sm since
pmd->data_sm may be destroyed by other processes.
P1(kworker) P2(message)
do_worker
process_prepared
process_prepared_discard_passdown_pt2
dm_pool_dec_data_range
pool_message
commit
dm_pool_commit_metadata
↓
// commit failed
metadata_operation_failed
abort_transaction
dm_pool_abort_metadata
__open_or_format_metadata
↓
dm_sm_disk_open
↓
// open failed
// pmd->data_sm is NULL
dm_sm_dec_blocks
↓
// try to access pmd->data_sm --> UAF
As shown above, if dm_pool_commit_metadata() and
dm_pool_abort_metadata() fail in pool_message process, kworker may
trigger UAF.
Fixes: be500ed721a6 ("dm space maps: improve performance with inc/dec on ranges of blocks")
Cc: stable@vger.kernel.org
Signed-off-by: Li Lingfeng <lilingfeng3@huawei.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to 'drivers/dax/cxl.c')
0 files changed, 0 insertions, 0 deletions