summaryrefslogtreecommitdiffstats
path: root/drivers/video/output.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2012-02-21 02:57:33 +0000
committerBen Hutchings <bhutchings@solarflare.com>2012-02-22 20:48:08 +0000
commit01cb543db8a2d2dbcea5f357365ce1327ac46193 (patch)
tree34f19534fcc79f1e2616424fa26fda2851918335 /drivers/video/output.c
parentc3cb2a874122889c036934294dbbb8ad82f53060 (diff)
downloadblackbird-op-linux-01cb543db8a2d2dbcea5f357365ce1327ac46193.tar.gz
blackbird-op-linux-01cb543db8a2d2dbcea5f357365ce1327ac46193.zip
sfc: Correct validation of peer_page_count in efx_vfdi_set_status_page()
efx_vfdi_set_status_page() validates the peer page count by calculating the size of a request containing that many addresses and comparing that with the maximum valid request size (4KB). The calculation involves a multiplication that may overflow on a 32-bit system. We use kcalloc() to allocate memory to store the addresses; that also does a multiplication and it does check for integer overflow, so any values larger than 0x1fffffff will be rejected. However, values in the range [0x1fffffffc, 0x1fffffff] pass boh tests and result in an attempt to allocate nearly 4GB on the heap. This should be rejected rather quickly as it's obviously impossible on a 32-bit system, and indeed the maximum possible heap allocation is 32MB. Still, let's make absolutely sure by fixing the initial validation. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/video/output.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud