Skip to content
Snippets Groups Projects
Select Git revision
  • v2.3.1
  • master default
  • sp/trace-zero-ranges
  • stable-2.5
  • stable-2.4
  • stable-2.3
  • stable-2.2
  • stable-2.1
  • stable-2.0
  • stable-1.7
  • stable-1.6
  • stable-1.5
  • stable-1.4
  • stable-1.3
  • stable-1.2
  • stable-1.1
  • stable-1.0
  • stable-0.15
  • stable-0.14
  • stable-0.13
  • stable-0.12
  • v2.7.0-rc1
  • v2.7.0-rc0
  • v2.6.0
  • v2.5.1.1
  • v2.6.0-rc5
  • v2.6.0-rc4
  • v2.6.0-rc3
  • v2.6.0-rc2
  • v2.6.0-rc1
  • v2.6.0-rc0
  • v2.5.1
  • v2.5.0
  • v2.5.0-rc4
  • v2.5.0-rc3
  • v2.5.0-rc2
  • v2.5.0-rc1
  • v2.5.0-rc0
  • v2.4.1
  • v2.4.0.1
40 results

block

  • Open with
  • Download source code
  • Download directory
  • Your workspaces

      A workspace is a virtual sandbox environment for your code in GitLab.

      No agents available to create workspaces. Please consult Workspaces documentation for troubleshooting.

  • user avatar
    Jeff Cody authored and Michael Roth committed
    When we allocate the pagetable based on max_table_entries, we multiply
    the max table entry value by 4 to accomodate a table of 32-bit integers.
    However, max_table_entries is a uint32_t, and the VPC driver accepts
    ranges for that entry over 0x40000000.  So during this allocation:
    
    s->pagetable = qemu_try_blockalign(bs->file, s->max_table_entries * 4);
    
    The size arg overflows, allocating significantly less memory than
    expected.
    
    Since qemu_try_blockalign() size argument is size_t, cast the
    multiplication correctly to prevent overflow.
    
    The value of "max_table_entries * 4" is used elsewhere in the code as
    well, so store the correct value for use in all those cases.
    
    We also check the Max Tables Entries value, to make sure that it is <
    SIZE_MAX / 4, so we know the pagetable size will fit in size_t.
    
    Cc: qemu-stable@nongnu.org
    Reported-by: default avatarRichard W.M. Jones <rjones@redhat.com>
    Signed-off-by: default avatarJeff Cody <jcody@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    (cherry picked from commit b15deac7)
    Signed-off-by: default avatarMichael Roth <mdroth@linux.vnet.ibm.com>
    358f0ee2
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.