Commit dc30c01
drm/i915: fix race condition UAF in i915_perf_add_config_ioctl
Userspace can guess the id value and try to race oa_config object creation
with config remove, resulting in a use-after-free if we dereference the
object after unlocking the metrics_lock. For that reason, unlocking the
metrics_lock must be done after we are done dereferencing the object.
Signed-off-by: Min Li <lm0963hack@gmail.com>
Fixes: f89823c ("drm/i915/perf: Implement I915_PERF_ADD/REMOVE_CONFIG interface")
Cc: <stable@vger.kernel.org> # v4.14+
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230328093627.5067-1-lm0963hack@gmail.com
[tursulin: Manually added stable tag.]
(cherry picked from commit 49f6f64)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>1 parent 95d939b commit dc30c01
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4638 | 4638 | | |
4639 | 4639 | | |
4640 | 4640 | | |
4641 | | - | |
4642 | | - | |
| 4641 | + | |
4643 | 4642 | | |
4644 | 4643 | | |
4645 | 4644 | | |
| 4645 | + | |
4646 | 4646 | | |
4647 | | - | |
| 4647 | + | |
4648 | 4648 | | |
4649 | 4649 | | |
4650 | 4650 | | |
| |||
0 commit comments