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
This commit is contained in:
Yongbo Yao
2025-01-19 10:50:18 -06:00
committed by David Bright
parent c5056a3931
commit 2f35419fb2
+2
View File
@@ -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.