Commit 504cf18e authored by Michael Müller's avatar Michael Müller Committed by Alexandre Julliard

server: Hold a reference to the file in delete_file().

Otherwise, we may attempt to access freed memory trawling the device list. This can occur if a device driver crashes during an IRP_CALL_CLOSE request. Signed-off-by: 's avatarZebediah Figura <z.figura12@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 0bd7da42
......@@ -729,12 +729,17 @@ static void delete_file( struct device_file *file )
{
struct irp_call *irp, *next;
/* the pending requests may be the only thing holding a reference to the file */
grab_object( file );
/* terminate all pending requests */
LIST_FOR_EACH_ENTRY_SAFE( irp, next, &file->requests, struct irp_call, dev_entry )
{
list_remove( &irp->mgr_entry );
set_irp_result( irp, STATUS_FILE_DELETED, NULL, 0, 0 );
}
release_object( file );
}
static void delete_device( struct device *device )
......
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