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

UefiPayloadPkg: Integer Overflow in CreateHob() #5252

Merged
merged 2 commits into from
Jan 16, 2024

Conversation

gguo11837463
Copy link
Contributor

No description provided.

@gguo11837463 gguo11837463 changed the title Bz4166: Integer Overflow in CreateHob() Bugzilla 4166: Integer Overflow in CreateHob() Jan 11, 2024
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4166

Fix integer overflow in various CreateHob instances.
Fixes: CVE-2022-36765

The CreateHob() function aligns the requested size to 8
performing the following operation:
```
HobLength = (UINT16)((HobLength + 0x7) & (~0x7));
```

No checks are performed to ensure this value doesn't
overflow, and could lead to CreateHob() returning a smaller
HOB than requested, which could lead to OOB HOB accesses.

Reported-by: Marc Beatove <mbeatove@google.com>
Cc: Guo Dong <guo.dong@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Reviewed-by: Gua Guo <gua.guo@intel.com>
Cc: John Mathew <john.mathews@intel.com>
Authored-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gua Guo <gua.guo@intel.com>
@gguo11837463 gguo11837463 changed the title Bugzilla 4166: Integer Overflow in CreateHob() UefiPayloadPkg: Integer Overflow in CreateHob() Jan 16, 2024
@gguo11837463 gguo11837463 added the push Auto push patch series in PR if all checks pass label Jan 16, 2024
@mergify mergify bot merged commit 59f024c into tianocore:master Jan 16, 2024
105 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
push Auto push patch series in PR if all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant