Commit f3851d6
Herton R. Krzesinski
Merge: mm/hugetlb: address race condition in hugetlb_no_page()
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/1875
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2158123
CVE: CVE-2022-3522
hugetlb_no_page() is called without holding the page table lock,
as it takes the spinlock later down the execution path, when it
really is installing the PTE in the page tables. That, however,
opens up a window for data races when evaluating the PTE value
for USERFAULTD fault handling.
Rafael Aquini (4):
mm/hugetlb: handle pte markers in page faults
mm/hugetlb: fix race condition of uffd missing/minor handling
mm/hugetlb: use hugetlb_pte_stable in migration race check
mm/selftest: uffd: explain the write missing fault check
mm/hugetlb.c | 69 +++++++++++++++++++++---
tools/testing/selftests/vm/userfaultfd.c | 22 +++++++-
2 files changed, 82 insertions(+), 9 deletions(-)
Signed-off-by: Rafael Aquini <aquini@redhat.com>
Approved-by: Peter Xu <peterx@redhat.com>
Approved-by: Waiman Long <longman@redhat.com>
Approved-by: Aristeu Rozanski <arozansk@redhat.com>
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>2 files changed
+82
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5481 | 5481 | | |
5482 | 5482 | | |
5483 | 5483 | | |
| 5484 | + | |
| 5485 | + | |
| 5486 | + | |
| 5487 | + | |
| 5488 | + | |
| 5489 | + | |
| 5490 | + | |
| 5491 | + | |
| 5492 | + | |
| 5493 | + | |
| 5494 | + | |
| 5495 | + | |
| 5496 | + | |
| 5497 | + | |
| 5498 | + | |
| 5499 | + | |
| 5500 | + | |
5484 | 5501 | | |
5485 | 5502 | | |
5486 | 5503 | | |
5487 | | - | |
| 5504 | + | |
| 5505 | + | |
5488 | 5506 | | |
5489 | 5507 | | |
5490 | 5508 | | |
| |||
5523 | 5541 | | |
5524 | 5542 | | |
5525 | 5543 | | |
| 5544 | + | |
| 5545 | + | |
| 5546 | + | |
| 5547 | + | |
| 5548 | + | |
| 5549 | + | |
| 5550 | + | |
| 5551 | + | |
| 5552 | + | |
| 5553 | + | |
| 5554 | + | |
| 5555 | + | |
| 5556 | + | |
| 5557 | + | |
| 5558 | + | |
| 5559 | + | |
| 5560 | + | |
| 5561 | + | |
| 5562 | + | |
| 5563 | + | |
| 5564 | + | |
| 5565 | + | |
5526 | 5566 | | |
5527 | 5567 | | |
5528 | 5568 | | |
| |||
5543 | 5583 | | |
5544 | 5584 | | |
5545 | 5585 | | |
5546 | | - | |
5547 | | - | |
5548 | | - | |
| 5586 | + | |
5549 | 5587 | | |
5550 | | - | |
| 5588 | + | |
| 5589 | + | |
5551 | 5590 | | |
5552 | 5591 | | |
5553 | 5592 | | |
| |||
5587 | 5626 | | |
5588 | 5627 | | |
5589 | 5628 | | |
| 5629 | + | |
| 5630 | + | |
| 5631 | + | |
| 5632 | + | |
| 5633 | + | |
5590 | 5634 | | |
5591 | 5635 | | |
5592 | 5636 | | |
| |||
5611 | 5655 | | |
5612 | 5656 | | |
5613 | 5657 | | |
5614 | | - | |
| 5658 | + | |
| 5659 | + | |
5615 | 5660 | | |
5616 | 5661 | | |
5617 | 5662 | | |
| |||
5621 | 5666 | | |
5622 | 5667 | | |
5623 | 5668 | | |
| 5669 | + | |
| 5670 | + | |
| 5671 | + | |
| 5672 | + | |
| 5673 | + | |
| 5674 | + | |
5624 | 5675 | | |
5625 | 5676 | | |
5626 | 5677 | | |
| |||
5738 | 5789 | | |
5739 | 5790 | | |
5740 | 5791 | | |
5741 | | - | |
5742 | | - | |
| 5792 | + | |
| 5793 | + | |
| 5794 | + | |
| 5795 | + | |
5743 | 5796 | | |
5744 | 5797 | | |
5745 | 5798 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
703 | 703 | | |
704 | 704 | | |
705 | 705 | | |
706 | | - | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
707 | 727 | | |
708 | 728 | | |
709 | 729 | | |
| |||
0 commit comments