i2c: pm_smbus: check smb_index before block transfer write
While performing block transfer write in smb_ioport_writeb(), 'smb_index' is incremented and used to index smb_data[] array. Check 'smb_index' value to avoid OOB access. Note that this bug is exploitable by a guest to escape from the virtual machine. However the commit which introduced the bug was only made after the 3.0 release, and so it is not present in any released QEMU versions. Fixes: 38ad4fae i2c: pm_smbus: Add block transfer capability Reported-by: NMichael Hanselmann <public@hansmi.ch> Signed-off-by: NPrasad J Pandit <pjp@fedoraproject.org> Reviewed-by: NIgor Mammedov <imammedo@redhat.com> Reviewed-by: NLi Qiang <liq3ea@gmail.com> Reviewed-by: NMichael Hanselmann <public@hansmi.ch> Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: NMichael S. Tsirkin <mst@redhat.com> Message-id: 20181206121830.6177-1-ppandit@redhat.com Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
Showing
想要评论请 注册 或 登录