Bug 205477 - Useless address check in function __kvm_set_memory_region()
Summary: Useless address check in function __kvm_set_memory_region()
Status: RESOLVED INVALID
Alias: None
Product: Virtualization
Classification: Unclassified
Component: kvm (show other bugs)
Hardware: All Linux
: P1 low
Assignee: virtualization_kvm
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-09 14:24 UTC by Alexandr Ivanov
Modified: 2019-11-12 07:10 UTC (History)
1 user (show)

See Also:
Kernel Version: 5.2.0
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Alexandr Ivanov 2019-11-09 14:24:12 UTC
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;
Comment 1 Sean Christopherson 2019-11-11 18:15:37 UTC
No, the check catches cases where @mem wraps to zero, e.g. guest_phys_addr = 0xfffffffffffff000 and memory_size >= 0x1000.
Comment 2 Alexandr Ivanov 2019-11-12 07:10:43 UTC
(In reply to Sean Christopherson from comment #1)
> 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.

Note You need to log in before you can comment on or make changes to this bug.