sdhci.c: Limit the maximum block size
commit9201bb9a8c7cd3ba2382b7db5b2e40f603e61528
authorAlistair Francis <alistair.francis@xilinx.com>
Tue, 6 Oct 2015 17:40:41 +0000 (6 10:40 -0700)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 12 Oct 2015 10:17:45 +0000 (12 11:17 +0100)
tree131b06da5d5ab464f77a00bd67704c0234989b2d
parentc84b31926f018af6fea2ab37a1fc47060b4bcfa1
sdhci.c: Limit the maximum block size

It is possible for the guest to set an invalid block
size which is larger then the fifo_buffer[] array. This
could cause a buffer overflow.

To avoid this limit the maximum size of the blksize variable.

Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
Reported-by: Intel Security ATR <secure@intel.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Message-id: abe4c51f513290bbb85d1ee271cb1a3d463d7561.1444067470.git.alistair.francis@xilinx.com
Suggested-by: Igor Mitsyanko <i.mitsyanko@gmail.com>
Reported-by: Intel Security ATR <secure@intel.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/sd/sdhci.c