sched/core: Fix use after free issue in is_sched_lib_based_app()
is_sched_lib_based_app() function introduced by 'commit d43b69c4ad2a ("sched/core: fix userspace affining threads incorrectly")' traverses all the executable VMA regions of a task for which the affinity change is requested by the userspace. The mm->mmap_sem lock is acquired to lock the VMA regions, however the task mm itself can go away when the task is exited. The get_task_struct() does not prevent this from happening. Add protection by incrementing task's mm reference count. Change-Id: I39d835a8d7d53d9b9eca90baf73d3fcfad9d164b Signed-off-by:Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by:
Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
Loading
Please register or sign in to comment