Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the issue that the gBS->LoadImage pointer was empty. #691

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jinlun123123123
Copy link

The interface shouldn't be replaced at the shim_fini
stage When the vendor certificate doesn't exist.

The interface shouldn't be replaced at the shim_fini
 stage When the vendor certificate doesn't exist.

Signed-off-by: Lun Jin <[email protected]>
@kukrimate
Copy link

kukrimate commented Sep 22, 2024

		if (vendor_authorized_size || vendor_deauthorized_size) {
			/*
			 * If shim includes its own certificates then ensure
			 * that anything it boots has performed some
			 * validation of the next image.
			 */
			hook_system_services(systab);
			loader_is_participating = 0;
		}

The above is the hook installation code from shim_init. Hook is indeed only installed when moklist or moklistx is non-empty.

I hope there are no signed shims on the UEFI 3rd party CA with this condition.

EDIT: I initially thought this might be an exploitable UAF, but looks like the pointers written to the system table are always NULL, and I don't think there is any signed UEFI application that would allow an attacker to put shellcode there so maybe it's just an annoying crash.

@xcfxr
Copy link

xcfxr commented Oct 12, 2024

		if (vendor_authorized_size || vendor_deauthorized_size) {
			/*
			 * If shim includes its own certificates then ensure
			 * that anything it boots has performed some
			 * validation of the next image.
			 */
			hook_system_services(systab);
			loader_is_participating = 0;
		}

The above is the hook installation code from shim_init. Hook is indeed only installed when moklist or moklistx is non-empty.

I hope there are no signed shims on the UEFI 3rd party CA with this condition.

EDIT: I initially thought this might be an exploitable UAF, but looks like the pointers written to the system table are always NULL, and I don't think there is any signed UEFI application that would allow an attacker to put shellcode there so maybe it's just an annoying crash.

From the perspective of the logical integrity of the code, shim_fini needs to make the same judgment when uninstalling the hook, so this pr is meaningful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants