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:
@@ -565,6 +565,8 @@ efihttp_fs_open(const char *path, struct open_file *f)
|
|||||||
|
|
||||||
if (!efihttp_init_done)
|
if (!efihttp_init_done)
|
||||||
return (ENXIO);
|
return (ENXIO);
|
||||||
|
if (f->f_dev != &efihttp_dev)
|
||||||
|
return (EINVAL);
|
||||||
/*
|
/*
|
||||||
* If any path fails to open, try with a trailing slash in
|
* If any path fails to open, try with a trailing slash in
|
||||||
* case it's a directory.
|
* case it's a directory.
|
||||||
|
|||||||
Reference in New Issue
Block a user