tianocore / edk2

EDK II
https://github.com/tianocore/tianocore.github.io/wiki/EDK-II
Other
4.52k stars 2.44k forks source link

MdeModulePkg: DxeCore: Fix Use-After-Free guard causing page fault #5919

Closed kuqin12 closed 1 month ago

kuqin12 commented 1 month ago

Description

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2411

With Use-After-Free heap guard feature enabled, the DxeCore would blindly attempt to "level-up" when the GuardAllFreedPages inspect a non-max level table entry from the last loop. This could cause the next round of inspection to dereference a potentially null pointer and as such causing a page fault.

This change adds a null pointer check to prevent such case from happening.

How This Was Tested

This is tested on QEMU based virtual platforms.

Integration Instructions

N/A

kuqin12 commented 1 month ago

@lgao4 Could you please review the PR and provide feedback when you have a chance? Thanks!

Javagedes commented 1 month ago

@mergify refresh

mergify[bot] commented 1 month ago

refresh

✅ Pull request refreshed

Javagedes commented 1 month ago

@mergify queue

mergify[bot] commented 1 month ago

queue

🟠 The pull request is the 2nd in the queue to be merged

#5919 is queued for merge in the [default queue](https://dashboard.mergify.com/github/tianocore/repo/edk2/queues/partitions/__default__?queues=default&branch=master)). **Required conditions of queue** `default` **for merge:** - [ ] `#approved-reviews-by>=1` [🛡 GitHub branch protection] - [ ] `#changes-requested-reviews-by=0` [🛡 GitHub branch protection] - [ ] `#review-threads-unresolved=0` [🛡 GitHub branch protection] - [ ] `base~=(^main|^master|^stable/)` - [ ] `label=push` - [ ] any of: [🛡 GitHub branch protection] - [ ] `check-neutral=Ubuntu GCC5 PR` - [ ] `check-skipped=Ubuntu GCC5 PR` - [ ] `check-success=Ubuntu GCC5 PR` - [ ] any of: [🛡 GitHub branch protection] - [ ] `check-neutral=Windows VS2019 PR` - [ ] `check-skipped=Windows VS2019 PR` - [ ] `check-success=Windows VS2019 PR` - [ ] any of: [🛡 GitHub branch protection] - [ ] `check-neutral=tianocore.PatchCheck` - [ ] `check-skipped=tianocore.PatchCheck` - [ ] `check-success=tianocore.PatchCheck` - [ ] any of: [🛡 GitHub branch protection] - [ ] `check-neutral=PlatformCI_ArmVirtPkg_Ubuntu_GCC5_PR` - [ ] `check-skipped=PlatformCI_ArmVirtPkg_Ubuntu_GCC5_PR` - [ ] `check-success=PlatformCI_ArmVirtPkg_Ubuntu_GCC5_PR` - [ ] any of: [🛡 GitHub branch protection] - [ ] `check-neutral=PlatformCI_EmulatorPkg_Ubuntu_GCC5_PR` - [ ] `check-skipped=PlatformCI_EmulatorPkg_Ubuntu_GCC5_PR` - [ ] `check-success=PlatformCI_EmulatorPkg_Ubuntu_GCC5_PR` - [ ] any of: [🛡 GitHub branch protection] - [ ] `check-neutral=PlatformCI_EmulatorPkg_Windows_VS2019_PR` - [ ] `check-skipped=PlatformCI_EmulatorPkg_Windows_VS2019_PR` - [ ] `check-success=PlatformCI_EmulatorPkg_Windows_VS2019_PR` - [ ] any of: [🛡 GitHub branch protection] - [ ] `check-neutral=PlatformCI_OvmfPkg_Ubuntu_GCC5_PR` - [ ] `check-skipped=PlatformCI_OvmfPkg_Ubuntu_GCC5_PR` - [ ] `check-success=PlatformCI_OvmfPkg_Ubuntu_GCC5_PR` - [ ] any of: [🛡 GitHub branch protection] - [ ] `check-neutral=PlatformCI_OvmfPkg_Windows_VS2019_PR` - [ ] `check-skipped=PlatformCI_OvmfPkg_Windows_VS2019_PR` - [ ] `check-success=PlatformCI_OvmfPkg_Windows_VS2019_PR` **Required conditions to stay in the queue:** - [X] `-draft` [📌 queue requirement] - [X] any of: [📌 queue -> configuration change requirements] - [X] `-mergify-configuration-changed` - [ ] `check-success=Configuration changed` - [X] any of: [🔀 queue conditions] - [X] all of: [📌 queue conditions of queue `default`] - [X] `#approved-reviews-by>=1` [🛡 GitHub branch protection] - [X] `#changes-requested-reviews-by=0` [🛡 GitHub branch protection] - [X] `#review-threads-unresolved=0` [🛡 GitHub branch protection] - [X] any of: [🛡 GitHub branch protection] - [X] `check-success=Ubuntu GCC5 PR` - [ ] `check-neutral=Ubuntu GCC5 PR` - [ ] `check-skipped=Ubuntu GCC5 PR` - [X] any of: [🛡 GitHub branch protection] - [X] `check-success=Windows VS2019 PR` - [ ] `check-neutral=Windows VS2019 PR` - [ ] `check-skipped=Windows VS2019 PR` - [X] any of: [🛡 GitHub branch protection] - [X] `check-success=tianocore.PatchCheck` - [ ] `check-neutral=tianocore.PatchCheck` - [ ] `check-skipped=tianocore.PatchCheck` - [X] any of: [🛡 GitHub branch protection] - [X] `check-success=PlatformCI_ArmVirtPkg_Ubuntu_GCC5_PR` - [ ] `check-neutral=PlatformCI_ArmVirtPkg_Ubuntu_GCC5_PR` - [ ] `check-skipped=PlatformCI_ArmVirtPkg_Ubuntu_GCC5_PR` - [X] any of: [🛡 GitHub branch protection] - [X] `check-success=PlatformCI_EmulatorPkg_Ubuntu_GCC5_PR` - [ ] `check-neutral=PlatformCI_EmulatorPkg_Ubuntu_GCC5_PR` - [ ] `check-skipped=PlatformCI_EmulatorPkg_Ubuntu_GCC5_PR` - [X] any of: [🛡 GitHub branch protection] - [X] `check-success=PlatformCI_EmulatorPkg_Windows_VS2019_PR` - [ ] `check-neutral=PlatformCI_EmulatorPkg_Windows_VS2019_PR` - [ ] `check-skipped=PlatformCI_EmulatorPkg_Windows_VS2019_PR` - [X] any of: [🛡 GitHub branch protection] - [X] `check-success=PlatformCI_OvmfPkg_Ubuntu_GCC5_PR` - [ ] `check-neutral=PlatformCI_OvmfPkg_Ubuntu_GCC5_PR` - [ ] `check-skipped=PlatformCI_OvmfPkg_Ubuntu_GCC5_PR` - [X] any of: [🛡 GitHub branch protection] - [X] `check-success=PlatformCI_OvmfPkg_Windows_VS2019_PR` - [ ] `check-neutral=PlatformCI_OvmfPkg_Windows_VS2019_PR` - [ ] `check-skipped=PlatformCI_OvmfPkg_Windows_VS2019_PR`
kuqin12 commented 1 month ago

@mergify rebase

mergify[bot] commented 1 month ago

rebase

☑️ Nothing to do

- [ ] `queue-position=-1` [📌 rebase requirement] - [X] `-closed` [📌 rebase requirement] - [X] `-conflict` [📌 rebase requirement] - [X] any of: - [X] `#commits-behind>0` [📌 rebase requirement] - [ ] `#commits>1` [📌 rebase requirement] - [ ] `-linear-history` [📌 rebase requirement]
kuqin12 commented 1 month ago

@mergify refresh

mergify[bot] commented 1 month ago

refresh

✅ Pull request refreshed

kuqin12 commented 1 month ago

@mergify queue

mergify[bot] commented 1 month ago

queue

❌ Command disallowed due to command restrictions in the Mergify configuration.

- [ ] `sender-permission>=write`