Commit 9bcac97
KVM: x86: Reset IRTE to host control if *new* route isn't postable
Restore an IRTE back to host control (remapped or posted MSI mode) if the
*new* GSI route prevents posting the IRQ directly to a vCPU, regardless of
the GSI routing type. Updating the IRTE if and only if the new GSI is an
MSI results in KVM leaving an IRTE posting to a vCPU.
The dangling IRTE can result in interrupts being incorrectly delivered to
the guest, and in the worst case scenario can result in use-after-free,
e.g. if the VM is torn down, but the underlying host IRQ isn't freed.
Fixes: efc6440 ("KVM: x86: Update IRTE for posted-interrupts")
Fixes: 411b44b ("svm: Implements update_pi_irte hook to setup posted interrupt")
Cc: [email protected]
Signed-off-by: Sean Christopherson <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>1 parent 7537ded commit 9bcac97
2 files changed
+41
-45
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
896 | 896 | | |
897 | 897 | | |
898 | 898 | | |
| 899 | + | |
899 | 900 | | |
900 | 901 | | |
901 | 902 | | |
| |||
932 | 933 | | |
933 | 934 | | |
934 | 935 | | |
| 936 | + | |
| 937 | + | |
935 | 938 | | |
936 | 939 | | |
937 | 940 | | |
| |||
950 | 953 | | |
951 | 954 | | |
952 | 955 | | |
953 | | - | |
954 | | - | |
955 | | - | |
956 | | - | |
957 | | - | |
958 | | - | |
959 | | - | |
960 | | - | |
961 | | - | |
962 | | - | |
963 | | - | |
964 | | - | |
965 | | - | |
966 | | - | |
967 | | - | |
968 | | - | |
969 | | - | |
970 | | - | |
971 | | - | |
972 | | - | |
973 | | - | |
974 | | - | |
975 | | - | |
976 | | - | |
977 | | - | |
978 | | - | |
979 | | - | |
980 | 956 | | |
981 | 957 | | |
982 | 958 | | |
| |||
992 | 968 | | |
993 | 969 | | |
994 | 970 | | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
995 | 999 | | |
996 | 1000 | | |
997 | 1001 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
| 300 | + | |
300 | 301 | | |
301 | 302 | | |
302 | 303 | | |
| |||
335 | 336 | | |
336 | 337 | | |
337 | 338 | | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
| 339 | + | |
351 | 340 | | |
352 | | - | |
353 | 341 | | |
354 | 342 | | |
355 | 343 | | |
356 | 344 | | |
357 | 345 | | |
358 | 346 | | |
359 | 347 | | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
| 348 | + | |
| 349 | + | |
364 | 350 | | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
365 | 354 | | |
366 | 355 | | |
367 | 356 | | |
368 | 357 | | |
369 | 358 | | |
370 | 359 | | |
371 | 360 | | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
372 | 364 | | |
373 | 365 | | |
374 | 366 | | |
| |||
0 commit comments