sio: fix KASAN use-after-free

This commit is contained in:
Thomas Schoebel-Theuer 2020-04-04 09:46:00 +02:00
parent 9e6fb4120c
commit 56699c6bfb
1 changed files with 5 additions and 2 deletions

View File

@ -428,11 +428,14 @@ void _sio_ref_io(struct sio_threadinfo *tinfo, struct mref_object *mref)
mapfree_set(output->mf, mref->ref_pos, mref->ref_pos + mref->ref_len);
done:
if ((mref->ref_flags & MREF_WRITE) && status >= 0)
mf_dirty_append(output->mf,
DIRTY_FINISHED,
mref->ref_pos + mref->ref_len);
_complete(output, mref, status);
atomic_dec(&tinfo->fly_count);
if ((mref->ref_flags & MREF_WRITE) && status >= 0)
mf_dirty_append(output->mf, DIRTY_FINISHED, mref->ref_pos + mref->ref_len);
}
/* This is called from outside