Page MenuHomeFreeBSD

stand/efihttp: Add device type check to efihttp_fs_open()
ClosedPublic

Authored by yongbo.yao_dell.com on Jan 13 2025, 12:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 24, 5:29 PM
Unknown Object (File)
Wed, Oct 22, 6:56 PM
Unknown Object (File)
Tue, Oct 21, 11:48 PM
Unknown Object (File)
Sun, Oct 19, 6:14 AM
Unknown Object (File)
Fri, Oct 17, 7:19 AM
Unknown Object (File)
Sun, Oct 12, 3:30 AM
Unknown Object (File)
Sat, Oct 4, 8:43 PM
Unknown Object (File)
Sat, Oct 4, 5:40 AM

Details

Summary

Ensure the open operation targets an HTTP device. Return EINVAL if
not, to prevent potential system crashes when used on other devices.

Test Plan

When using httpboot to load the loader and then attempting to load the OS through another device type, a panic occurs when attempting to open a file using the HTTP file system. The steps to reproduce this issue are as follows:

  1. Preset the rootdev in the loader, for example: setenv('rootdev', 'disk3p2', 1).
  2. Load the loader using httpboot. Then during the loader runs, a panic will occur.

After adding the device type check to efihttp_fs_open(), the issue is gone.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable