From nobody Sun Jan 19 17:00:38 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YbfqW0HXcz5lTJZ; Sun, 19 Jan 2025 17:00:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YbfqV6ckqz3nY9; Sun, 19 Jan 2025 17:00:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737306039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ljo761V8ZJlioZoXJ2hIeJU/7D2W/H7C9YrcoMaugC0=; b=iMmwW+Y8Hr+n4QM2crJuz2Vm0BrK82GGbyqLMR86yIDkF7Dqa9AVyCbi9gdaywrT6XqV6v ctx7nbT22NzeZdRObAY0Cg7WDFiUUBg0TXpRAWCCAV5Zga6a1o9vS5vXj5b0ih90uOdPok FsQXwn4bNPEEV0uXS0q0OOFRokRC5kPnCFgeB0TcTFn8bNeKQxeCNYGvEZwGaekvUv9bio mJbQ5G0Nl+zmR14irVirDnoqlDUe5pBpMQXa6YfPNyblFViEgfNXdRocJka/StSIX3HUcg GuPoyEADHSqPUHLBi6svese1pW4eC5iOCfunL9k7tLq6tEVycNPcHimTAUIwBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737306039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ljo761V8ZJlioZoXJ2hIeJU/7D2W/H7C9YrcoMaugC0=; b=G9V94nQ/g2RQR1jqnZrx19P4TStc0GcnKPyf2wdOCDfX3+Wygcz10399O6/H/7IfGhNQTv RTlg29VXbfOU3Chjm9v9PSlQ/CqOk5vNE2DT00KlfyUKujIbhpFd/JWqLhc7EGTPdsbCGo 64HXFDRybYCrdRVXJnKHzVc57iNch6Q51m9IIbnVD8e9UTZOO2HNEG9BB4OhIQoPt4vXwD 29qJTchyEyp6smB1742Fjz6EPSUiFE/7aiGfbvX5UDkt/1m0GiNMsW5PTU8aPdl3s3VqdJ aOlKeI7jHgFM/SUytVuYrGlLMWFZrV1jqzrSwAHTpafGpBzlFNTCPPUe4+kLtw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737306039; a=rsa-sha256; cv=none; b=CiYgLCy0JsguyEAN+z6bjxyKpO4PYD8LKLqO9Jvl9VD5WdkcUD63TYV+yOfdHKgFoVESpF HExpamm53oA8n8Bh6zhPiIgKR3DZ45/pkCiU2Q1X607fa4vGYzZec4gXXq0u4ZU3aDG0pE w4Jmona5jMrOjr9ZI12aCsCyqVPWnw23hhwrJFCAoO+uiM6cSpwM+ByjIqbJwpHUCwYVqG R6AB6VtYK2DztNA8k3tT2b0RKplZ0fkrQ2i7sptD9MT8Jz6aruwcWaWHWoq8UF4JiuguU2 Ym7IV13Rwm0YqSZ3TuI37YhsWoGXOFWkY8o682zH/pUq/m0ArJ5kIIF4PpKgtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YbfqV69yNzyVM; Sun, 19 Jan 2025 17:00:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50JH0cIW090475; Sun, 19 Jan 2025 17:00:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50JH0c9a090472; Sun, 19 Jan 2025 17:00:38 GMT (envelope-from git) Date: Sun, 19 Jan 2025 17:00:38 GMT Message-Id: <202501191700.50JH0c9a090472@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: David Bright Subject: git: 2f35419fb26d - main - stand/efihttp: Add device type check to efihttp_fs_open() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dab X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2f35419fb26d1e45850696a8e732a12874bc1078 Auto-Submitted: auto-generated The branch main has been updated by dab: URL: https://cgit.FreeBSD.org/src/commit/?id=2f35419fb26d1e45850696a8e732a12874bc1078 commit 2f35419fb26d1e45850696a8e732a12874bc1078 Author: Yongbo Yao AuthorDate: 2025-01-19 16:50:18 +0000 Commit: David Bright CommitDate: 2025-01-19 17:00:26 +0000 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 --- stand/efi/libefi/efihttp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stand/efi/libefi/efihttp.c b/stand/efi/libefi/efihttp.c index bcc0f7e4d79e..fd0ed744047c 100644 --- a/stand/efi/libefi/efihttp.c +++ b/stand/efi/libefi/efihttp.c @@ -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.