Page MenuHomeFreeBSD

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

Authored by yongbo.yao_dell.com on Mon, Jan 13, 12:04 PM.

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 Skipped
Unit
Tests Skipped