]> git.proxmox.com Git - mirror_zfs.git/commit
Fix use-after-free in vdev_disk_physio_completion
authorChunwei Chen <david.chen@osnexus.com>
Tue, 13 Oct 2015 21:13:52 +0000 (14:13 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 13 Oct 2015 22:25:33 +0000 (15:25 -0700)
commitaa159afb568fff01bb9f427c16b406c5d29664c7
tree7dd2625923a14638c3338e10adddc8434222f5e0
parentbc4501f75a04ddf9c04cef8332d12b41c35863d5
Fix use-after-free in vdev_disk_physio_completion

Currently, vdev_disk_physio_completion will try to wake up an waiter without
first checking the existence. This creates a race window in which complete is
called after dr is freed.

We add dr_wait in dio_request to indicate the existence of waiter. Also,
remove dr_rw since no one is using it, and reorder dr_ref to make the struct
more compact in 64bit.

Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #3917
Issue #3880
module/zfs/vdev_disk.c