Skip to contentSkip to conversation

New: Useless address check in function __kvm_set_memory_region()

Bug 205477 [email protected] 1 participant 3 messages Nov 9, 2019 – Nov 12, 2019 KVM

lore
Share & tools
lore
#0 lore raw

https://bugzilla.kernel.org/show_bug.cgi?id=205477

            Bug ID: 205477
           Summary: Useless address check in function
                    __kvm_set_memory_region()
           Product: Virtualization
           Version: unspecified
    Kernel Version: 5.2.0
          Hardware: All
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: low
          Priority: P1
         Component: kvm
          Assignee: [email protected]
          Reporter: [email protected]
        Regression: No

In function __kvm_set_memory_region() at virt/kvm/kvm_main.c:950, the condition is false in any case.

950 if (mem->guest_phys_addr + mem->memory_size <
mem->guest_phys_addr)
951 goto out;

Signature · 2 lines
You are receiving this mail because:
You are watching the assignee of the bug.
#1 lore raw

[Bug 205477] Useless address check in function __kvm_set_memory_region()

https://bugzilla.kernel.org/show_bug.cgi?id=205477

Sean Christopherson ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------

                 CC|                            |sean.j.christopherson@intel
                   |                            |.com

--- Comment #1 from Sean Christopherson ([email protected]) --- No, the check catches cases where @mem wraps to zero, e.g. guest_phys_addr = 0xfffffffffffff000 and memory_size >= 0x1000.

Signature · 2 lines
You are receiving this mail because:
You are watching the assignee of the bug.
#2 lore raw

[Bug 205477] Useless address check in function __kvm_set_memory_region()

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=205477

Alexandr Ivanov ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from Alexandr Ivanov ([email protected]) --- (In reply to Sean Christopherson from comment #1)

Quoted 2 lines

No, the check catches cases where @mem wraps to zero, e.g. guest_phys_addr = 0xfffffffffffff000 and memory_size >= 0x1000.

Oh, sorry, I hadn't caught the idea.

Signature · 2 lines
You are receiving this mail because:
You are watching the assignee of the bug.