Skip to content
Commit 13698c0c authored by James Morse's avatar James Morse
Browse files

fs/resctrl: Avoid a race with dom_data_exit() and closid_num_dirty_rmid[]



On MPAM systems if an error occurs the arhictecture code will call
resctrl_exit(). This calls dom_data_exit() which takes the
rdrgroup_mutex and kfree()s closid_num_dirty_rmid[].

It is possible that another syscall tries to access that same array in
the meantime, but is blocked on the mutex. Once dom_data_exit()
completes, that syscall will see a NULL pointer.

Pull the IS_ENABLED() Kconfig checks into a helper and additionally
check that the array has been allocated. This will cause callers to
fallback to the regular CLOSID allocation strategy.

Signed-off-by: James Morse's avatarJames Morse <james.morse@arm.com>
parent 5159c6dd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment