Commit f947af0
fix potential undefined behavior condition
Fixed an unchecked arithmetic operation that could cause
undefined behavior. Attempting to load a malformed ELF
kernel image which contains a large enough entry address
in the ELF header, or a valid ELF image at a large enough
offset in guest memory, can lead to arithmetic overflow,
causing the result to wrap around. The result is meant to
be used as the value for the instruction pointer where the
guest will start booting from. This can result in the guest
executing code from undefined locations in guest memory
when the vCPUs start.
Signed-off-by: Alexandra Iordache <[email protected]>1 parent d72752a commit f947af0
1 file changed
+22
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
227 | 232 | | |
228 | 233 | | |
229 | 234 | | |
| |||
566 | 571 | | |
567 | 572 | | |
568 | 573 | | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
569 | 590 | | |
0 commit comments