aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongbo Yao <Yongbo.Yao@dell.com>2025-01-19 16:50:18 +0000
committerDavid Bright <dab@FreeBSD.org>2025-01-19 17:00:26 +0000
commit2f35419fb26d1e45850696a8e732a12874bc1078 (patch)
tree0795ae388feaacccbae9313953cda3be91fb2a7e
parentc5056a3931b41a803a24b89400d38d5c5f843612 (diff)
stand/efihttp: Add device type check to efihttp_fs_open()
Ensure the open operation targets an HTTP device. Return EINVAL if not, to prevent potential system crashes when used on other devices. Differential Revision: https://reviews.freebsd.org/D48439 Reviewed by: dab, imp, vangyzen Sponsored by: Dell Technologies
-rw-r--r--stand/efi/libefi/efihttp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/stand/efi/libefi/efihttp.c b/stand/efi/libefi/efihttp.c
index bcc0f7e4d79e..fd0ed744047c 100644
--- a/stand/efi/libefi/efihttp.c
+++ b/stand/efi/libefi/efihttp.c
@@ -565,6 +565,8 @@ efihttp_fs_open(const char *path, struct open_file *f)
if (!efihttp_init_done)
return (ENXIO);
+ if (f->f_dev != &efihttp_dev)
+ return (EINVAL);
/*
* If any path fails to open, try with a trailing slash in
* case it's a directory.