syzbot
ASan: Unauthorized Access in vioscsi_scsipi_request
Status:
fixed on 2019/04/13 22:14
Reported-by: syzbot+6513c4afe66237d7207f@syzkaller.appspotmail.com
Fix commit:
b60093a0824f
Fix use-after-free. If we're not polling, virtio_enqueue_commit() will send the transaction, and it means 'xs' can be immediately freed. So, save the value of xs_control beforehand.
First crash: 2754d, last: 2717d
Sample crash report:
login: [ 1923.3577502] ASan: Unauthorized Access In 0xffffffff816dd96d: Addr 0xffffab8012e590b8 [4 bytes, read, PoolUseAfterFree]
[ 1923.3719931] #0 0xffffffff816dd96d in vioscsi_scsipi_request <netbsd>
[ 1923.3807320] #1 0xffffffff802898dc in scsipi_adapter_request <netbsd>
[ 1923.3897714] #2 0xffffffff80289b10 in scsipi_run_queue <netbsd>
[ 1923.3979467] #3 0xffffffff8028a90f in scsipi_execute_xs <netbsd>
[ 1923.4061239] #4 0xffffffff802a2959 in sd_diskstart <netbsd>
[ 1923.4142982] #5 0xffffffff810df566 in dk_start <netbsd>
[ 1923.4216261] #6 0xffffffff810d48c0 in spec_strategy <netbsd>
[ 1923.4296054] #7 0xffffffff810c01bf in VOP_STRATEGY <netbsd>
[ 1923.4377400] #8 0xffffffff80f0f72e in ufs_strategy <netbsd>
[ 1923.4456263] #9 0xffffffff810c01bf in VOP_STRATEGY <netbsd>
[ 1923.4533578] #10 0xffffffff81079015 in bwrite <netbsd>
[ 1923.4606307] #11 0xffffffff810bc69a in VOP_BWRITE <netbsd>
[ 1923.4688053] #12 0xffffffff80ef9c87 in ufs_dircompact.isra.5 <netbsd>
2019/04/12 10:42:27 executed programs: 15591
[ 1923.4774302] #13 0xffffffff80efa231 in ufs_direnter <netbsd>
[ 1923.4861848] #14 0xffffffff80f0e4e4 in ufs_mkdir <netbsd>
2019/04/12 10:42:32 executed programs: 15761
2019/04/12 10:42:37 executed programs: 15900
* Struck through repros no longer work on HEAD.