From b7f1c682f3717560467f4c0176173aea4d873049 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 27 May 2017 17:46:03 +0200 Subject: [PATCH] Added patch to fix crash when a device driver segfaults during an open file request. --- patches/patchinstall.sh | 16 ++++++++ ...-when-a-device-driver-segfaults-duri.patch | 39 +++++++++++++++++++ .../server-device_manager_destroy/definition | 1 + 3 files changed, 56 insertions(+) create mode 100644 patches/server-device_manager_destroy/0001-server-Fix-crash-when-a-device-driver-segfaults-duri.patch create mode 100644 patches/server-device_manager_destroy/definition diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 51c63cf8..f8993441 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -326,6 +326,7 @@ patch_enable_all () enable_server_Signal_Thread="$1" enable_server_Stored_ACLs="$1" enable_server_Timestamp_Compat="$1" + enable_server_device_manager_destroy="$1" enable_setupapi_DelReg="$1" enable_setupapi_DiskSpaceList="$1" enable_setupapi_Display_Device="$1" @@ -1214,6 +1215,9 @@ patch_enable () server-Timestamp_Compat) enable_server_Timestamp_Compat="$2" ;; + server-device_manager_destroy) + enable_server_device_manager_destroy="$2" + ;; setupapi-DelReg) enable_setupapi_DelReg="$2" ;; @@ -7005,6 +7009,18 @@ if test "$enable_server_Timestamp_Compat" -eq 1; then ) >> "$patchlist" fi +# Patchset server-device_manager_destroy +# | +# | Modified files: +# | * server/device.c +# | +if test "$enable_server_device_manager_destroy" -eq 1; then + patch_apply server-device_manager_destroy/0001-server-Fix-crash-when-a-device-driver-segfaults-duri.patch + ( + printf '%s\n' '+ { "Michael Müller", "server: Fix crash when a device driver segfaults during an open file request.", 1 },'; + ) >> "$patchlist" +fi + # Patchset setupapi-DelReg # | # | This patchset fixes the following Wine bugs: diff --git a/patches/server-device_manager_destroy/0001-server-Fix-crash-when-a-device-driver-segfaults-duri.patch b/patches/server-device_manager_destroy/0001-server-Fix-crash-when-a-device-driver-segfaults-duri.patch new file mode 100644 index 00000000..c6a0eab4 --- /dev/null +++ b/patches/server-device_manager_destroy/0001-server-Fix-crash-when-a-device-driver-segfaults-duri.patch @@ -0,0 +1,39 @@ +From 7947b082f3d34c30f2c69e236db6723985faf35f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 27 May 2017 15:52:32 +0200 +Subject: server: Fix crash when a device driver segfaults during an open file + request. + +--- + server/device.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/server/device.c b/server/device.c +index 42f3e797ab9..a5928f520a9 100644 +--- a/server/device.c ++++ b/server/device.c +@@ -623,7 +623,11 @@ static void delete_device( struct device *device ) + if (!device->manager) return; /* already deleted */ + + LIST_FOR_EACH_ENTRY_SAFE( file, next, &device->files, struct device_file, entry ) ++ { ++ grab_object( &file->obj ); + delete_file( file ); ++ release_object( &file->obj ); ++ } + + unlink_named_object( &device->obj ); + list_remove( &device->entry ); +@@ -651,7 +655,9 @@ static void device_manager_destroy( struct object *obj ) + while ((ptr = list_head( &manager->devices ))) + { + struct device *device = LIST_ENTRY( ptr, struct device, entry ); ++ grab_object( &device->obj ); + delete_device( device ); ++ release_object( &device->obj ); + } + } + +-- +2.12.2 + diff --git a/patches/server-device_manager_destroy/definition b/patches/server-device_manager_destroy/definition new file mode 100644 index 00000000..47da407c --- /dev/null +++ b/patches/server-device_manager_destroy/definition @@ -0,0 +1 @@ +Fixes: Fix crash when a device driver segfaults during an open file request