[gvfs/gnome-3-20] udisks2: Fix crash when mounting encrypted volume
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs/gnome-3-20] udisks2: Fix crash when mounting encrypted volume
- Date: Mon, 18 Apr 2016 14:38:19 +0000 (UTC)
commit 874a51730e68b63544c748373237baba58f1b0a6
Author: Ondrej Holy <oholy redhat com>
Date: Mon Apr 18 13:02:42 2016 +0200
udisks2: Fix crash when mounting encrypted volume
Code handling external unlocks during mount operation was added by the
commit beea21e recently. Unfortunately, it may cause crashes due to
accessing already freed memory, because gvfs_udisks2_volume_monitor_update
waits for pending dbus messages using udisks_client_settle, thus another
main context iteration may happen (i.e. mount operation may finish and
mount data may be freed) before accessing mount data pointer. The mount
data pointer has to be obtained after gvfs_udisks2_volume_monitor_update
call in order to fix this crashes.
https://bugzilla.gnome.org/show_bug.cgi?id=765146
monitor/udisks2/gvfsudisks2volume.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/monitor/udisks2/gvfsudisks2volume.c b/monitor/udisks2/gvfsudisks2volume.c
index 8bb572d..2015339 100644
--- a/monitor/udisks2/gvfsudisks2volume.c
+++ b/monitor/udisks2/gvfsudisks2volume.c
@@ -608,10 +608,11 @@ on_udisks_client_changed (UDisksClient *client,
gpointer user_data)
{
GVfsUDisks2Volume *volume = GVFS_UDISKS2_VOLUME (user_data);
- MountData *data = volume->mount_pending_op;
+ MountData *data;
update_volume_on_event (volume);
+ data = volume->mount_pending_op;
if (data && data->mount_operation_aborted_handler_id && data->encrypted_to_unlock)
{
UDisksBlock *cleartext_block;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]