Commit 01bfe308 authored by James Morse's avatar James Morse Committed by Ben Hutchings

ACPI / APEI: Add missing synchronize_rcu() on NOTIFY_SCI removal

commit 7d64f82c upstream.

When removing a GHES device notified by SCI, list_del_rcu() is used,
ghes_remove() should call synchronize_rcu() before it goes on to call
kfree(ghes), otherwise concurrent RCU readers may still hold this list
entry after it has been freed.
Signed-off-by: default avatarJames Morse <james.morse@arm.com>
Reviewed-by: default avatar"Huang, Ying" <ying.huang@intel.com>
Fixes: 81e88fdc (ACPI, APEI, Generic Hardware Error Source POLL/IRQ/NMI notification type support)
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 4e153cff
...@@ -1020,6 +1020,7 @@ static int ghes_remove(struct platform_device *ghes_dev) ...@@ -1020,6 +1020,7 @@ static int ghes_remove(struct platform_device *ghes_dev)
if (list_empty(&ghes_sci)) if (list_empty(&ghes_sci))
unregister_acpi_hed_notifier(&ghes_notifier_sci); unregister_acpi_hed_notifier(&ghes_notifier_sci);
mutex_unlock(&ghes_list_mutex); mutex_unlock(&ghes_list_mutex);
synchronize_rcu();
break; break;
case ACPI_HEST_NOTIFY_NMI: case ACPI_HEST_NOTIFY_NMI:
mutex_lock(&ghes_list_mutex); mutex_lock(&ghes_list_mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment