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
F115466389: D48439.diff
Thu, Apr 24, 3:49 AM
Unknown Object (File)
Mon, Apr 21, 12:12 AM
Unknown Object (File)
Sun, Apr 20, 4:12 PM
Unknown Object (File)
Sun, Apr 20, 2:55 PM
Unknown Object (File)
Sun, Apr 20, 11:26 AM
Unknown Object (File)
Sun, Apr 20, 4:38 AM
Unknown Object (File)
Sun, Apr 20, 12:35 AM
Unknown Object (File)
Thu, Apr 17, 2:38 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