1From d87a7513c6f2f2824203032ef27caeb84892ed7e Mon Sep 17 00:00:00 2001
2From: Will Fancher <elvishjerricco@gmail.com>
3Date: Tue, 30 May 2023 16:53:20 -0400
4Subject: [PATCH] Intentionally break the fat driver
5
6---
7 FatPkg/EnhancedFatDxe/ReadWrite.c | 5 +++++
8 1 file changed, 5 insertions(+)
9
10diff --git a/FatPkg/EnhancedFatDxe/ReadWrite.c b/FatPkg/EnhancedFatDxe/ReadWrite.c
11index 8f525044d1f1..32c62ff7817b 100644
12--- a/FatPkg/EnhancedFatDxe/ReadWrite.c
13+++ b/FatPkg/EnhancedFatDxe/ReadWrite.c
14@@ -216,6 +216,11 @@ FatIFileAccess (
15 Volume = OFile->Volume;
16 Task = NULL;
17
18+ if (*BufferSize > (10U * 1024U * 1024U)) {
19+ IFile->Position += 10U * 1024U * 1024U;
20+ return EFI_BAD_BUFFER_SIZE;
21+ }
22+
23 //
24 // Write to a directory is unsupported
25 //