Commit 3a5c19c2 authored by James Bottomley's avatar James Bottomley

[SCSI] fix use-after-free in scsi_init_io()

we're using a pointer through a freed command to reset the request,
which has shown up as an oops with slab poisoning:
Reported-by: default avatarTejun Heo <tj@kernel.org>
Reported-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 7e443312
......@@ -1011,8 +1011,8 @@ int scsi_init_io(struct scsi_cmnd *cmd, gfp_t gfp_mask)
err_exit:
scsi_release_buffers(cmd);
scsi_put_command(cmd);
cmd->request->special = NULL;
scsi_put_command(cmd);
return error;
}
EXPORT_SYMBOL(scsi_init_io);
......
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