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 <james.morse@arm.com>
Loading
Please register or sign in to comment