summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlistair Strachan <alistair.strachan@imgtec.com>2015-03-24 14:51:31 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-26 10:58:51 +0100
commit8e43c9c75faf2902955bd2ecd7a50a8cc41cb00a (patch)
tree2680a770d5eefc7bba18ff3d94c871826fb146f0
parent0270c6257701a33262239ffc38442f18ae047d98 (diff)
downloadkernel-8e43c9c75faf2902955bd2ecd7a50a8cc41cb00a.tar.gz
staging: android: sync: Fix memory corruption in sync_timeline_signal().
The android_fence_release() function checks for active sync points by calling list_empty() on the list head embedded on the sync point. However, it is only valid to use list_empty() on nodes that have been initialized with INIT_LIST_HEAD() or list_del_init(). Because the list entry has likely been removed from the active list by sync_timeline_signal(), there is a good chance that this WARN_ON_ONCE() will be hit due to dangling pointers pointing at freed memory (even though the sync drivers did nothing wrong) and memory corruption will ensue as the list entry is removed for a second time, corrupting the active list. This problem can be reproduced quite easily with CONFIG_DEBUG_LIST=y and fences with more than one sync point. Signed-off-by: Alistair Strachan <alistair.strachan@imgtec.com> Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Colin Cross <ccross@google.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/android/sync.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c
index 7bdb62bf6b40..f83e00c78051 100644
--- a/drivers/staging/android/sync.c
+++ b/drivers/staging/android/sync.c
@@ -114,7 +114,7 @@ void sync_timeline_signal(struct sync_timeline *obj)
list_for_each_entry_safe(pt, next, &obj->active_list_head,
active_list) {
if (fence_is_signaled_locked(&pt->base))
- list_del(&pt->active_list);
+ list_del_init(&pt->active_list);
}
spin_unlock_irqrestore(&obj->child_list_lock, flags);
2.y&id=e889a311f74f4ae8bd40755a2c58d02e1c684fef'>gpu: host1x: Correct allocated size for contextsJohnny Liu 2023-10-11gpu: host1x: Syncpoint interrupt shardingMikko Perttunen 2023-10-11gpu: host1x: Enable system suspend callbacksMikko Perttunen 2023-10-11gpu: host1x: Stop CDMA before suspendingMikko Perttunen 2023-10-11gpu: host1x: Add locking in channel allocationMikko Perttunen 2023-07-27gpu: host1x: Return error when context device not attached to IOMMUMikko Perttunen 2023-07-21gpu/host1x: Explicitly include correct DT includesRob Herring 2023-07-21gpu: host1x: Stop open-coding of_device_uevent()Miquel Raynal 2023-04-06Merge tag 'drm/tegra/for-6.4-rc1' of https://gitlab.freedesktop.org/drm/tegra...Daniel Vetter 2023-04-04drm/tegra: Allow compile test on !ARM v2Christian König 2023-04-04gpu: host1x: Fix memory leak of device namesYang Yingliang 2023-04-04gpu: host1x: Fix potential double free if IOMMU is disabledYang Yingliang 2023-04-04gpu: host1x: mipi: Use devm_platform_get_and_ioremap_resource()Ye Xingchen 2023-04-04gpu: host1x: Don't rely on dma_fence_wait_timeout return valueMikko Perttunen 2023-04-04gpu: host1x: Make host1x_client_unregister() return voidUwe Kleine-König 2023-03-20gpu: host1x: fix uninitialized variable useArnd Bergmann 2023-02-24Merge tag 'iommu-updates-v6.3' of git://git.kernel.org/pub/scm/linux/kernel/g...Linus Torvalds