mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] efi: apple-properties: validate setup data header length
@ 2026-07-06  9:18 Pengpeng Hou
  2026-07-06 12:29 ` Lukas Wunner
  0 siblings, 1 reply; 3+ messages in thread
From: Pengpeng Hou @ 2026-07-06  9:18 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: Pengpeng Hou, Ilias Apalodimas, linux-efi, linux-kernel

map_properties() remaps the Apple properties setup_data payload
and then reads the properties header fields.

Reject a truncated payload before checking the header version and length
fields.

Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
---
 drivers/firmware/efi/apple-properties.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/firmware/efi/apple-properties.c b/drivers/firmware/efi/apple-properties.c
index 2e525e17fba7..f401a04edf4c 100644
--- a/drivers/firmware/efi/apple-properties.c
+++ b/drivers/firmware/efi/apple-properties.c
@@ -207,7 +207,10 @@ static int __init map_properties(void)
 		}
 
 		properties = (struct properties_header *)data->data;
-		if (properties->version != 1) {
+		if (data_len < sizeof(*properties)) {
+			pr_err("truncated properties header\n");
+			ret = -EINVAL;
+		} else if (properties->version != 1) {
 			pr_err("unsupported version:\n");
 			print_hex_dump(KERN_ERR, pr_fmt(), DUMP_PREFIX_OFFSET,
 			       16, 1, properties, data_len, true);
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] efi: apple-properties: validate setup data header length
  2026-07-06  9:18 [PATCH] efi: apple-properties: validate setup data header length Pengpeng Hou
@ 2026-07-06 12:29 ` Lukas Wunner
  2026-08-01 13:02   ` Ard Biesheuvel
  0 siblings, 1 reply; 3+ messages in thread
From: Lukas Wunner @ 2026-07-06 12:29 UTC (permalink / raw)
  To: Pengpeng Hou; +Cc: Ard Biesheuvel, Ilias Apalodimas, linux-efi, linux-kernel

On Mon, Jul 06, 2026 at 05:18:13PM +0800, Pengpeng Hou wrote:
> map_properties() remaps the Apple properties setup_data payload
> and then reads the properties header fields.
> 
> Reject a truncated payload before checking the header version and length
> fields.
> 
> Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>

Reviewed-by: Lukas Wunner <lukas@wunner.de>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] efi: apple-properties: validate setup data header length
  2026-07-06 12:29 ` Lukas Wunner
@ 2026-08-01 13:02   ` Ard Biesheuvel
  0 siblings, 0 replies; 3+ messages in thread
From: Ard Biesheuvel @ 2026-08-01 13:02 UTC (permalink / raw)
  To: Lukas Wunner, Pengpeng Hou; +Cc: Ilias Apalodimas, linux-efi, linux-kernel



On Mon, 6 Jul 2026, at 14:29, Lukas Wunner wrote:
> On Mon, Jul 06, 2026 at 05:18:13PM +0800, Pengpeng Hou wrote:
>> map_properties() remaps the Apple properties setup_data payload
>> and then reads the properties header fields.
>> 
>> Reject a truncated payload before checking the header version and length
>> fields.
>> 
>> Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
>
> Reviewed-by: Lukas Wunner <lukas@wunner.de>

Applied to efi/next - thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-01 13:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-06  9:18 [PATCH] efi: apple-properties: validate setup data header length Pengpeng Hou
2026-07-06 12:29 ` Lukas Wunner
2026-08-01 13:02   ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®