From nobody Tue Oct 18 15:20:35 2022 X-Original-To: bugs@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 4MsHcM2lgnz4g2gV for ; Tue, 18 Oct 2022 15:20:35 +0000 (UTC) (envelope-from bugzilla-noreply@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MsHcM1MS5z3S7X for ; Tue, 18 Oct 2022 15:20:35 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4MsHcM0QLTz1CSR for ; Tue, 18 Oct 2022 15:20:35 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 29IFKZjd068861 for ; Tue, 18 Oct 2022 15:20:35 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 29IFKYNC068860 for bugs@FreeBSD.org; Tue, 18 Oct 2022 15:20:34 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 266548] malicious gpt can cause kernel page fault during tasting Date: Tue, 18 Oct 2022 15:20:35 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666106435; 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: in-reply-to:in-reply-to:references:references; bh=Ts+9cqWRLf5kqcTqrHbBfHebxYpqgSamBQ69OHy7/Ho=; b=Gr8BbsqEdUWdrfo5idoeroFdO6DOK0bY8Ee11UMnVCFOk2iqgYFwVt71vNSFP4X06cusGC 6PJoeMw9ijs2lEeJ5CQxyaI/4MxAvQtZX0zVjoZNXWP3LfXi3JqzhTaUyJIG1Fgq3urBtI ePps5/INFcTsq/pHTFdcTCSzy087/YCNa5PwuCoM7rCMKDccq+dfpiYc6ZGvIrSdTAkZ8V iGhZG58ZVqEdoX2UXctArmHfUNtRMH3nPNVbbEPv3YPhwQPCKyokyWC3LxUN+4bcJ0I8Nb ZdrRnqbUFk5c8QgR0pqVlLitHrYtD6Zi6f83FYIYdQtk4ZTXKzTaFJa3wdcKFg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666106435; a=rsa-sha256; cv=none; b=Ae4tj/6oVOC7KoZbSAQ69fkvGlAf1oQl+HqSMOCy9KaPSzfaJ6Kx9Wv28un5ES24/gmtYe +dBWUbMjGasXeVkIC7dxtVyH7/+xXSDdVb9wlfmylHND4Qg6bP/FyH756Jh1tiwh08mozS KF1jvww6eUSHD32uIJpf3lCMjNBloORCRQXIlLPHhD3BNB+TvpdSqmf8pf7raDOGueVAHA uPp9f5YarNyc8wJmVKrh59SixWzC3Tu44f5mDdPPdHa46N1W6qv16WJRsfQGJoDhaMhcI/ YVZ99FcPg+WAPyxNM03LeeEOY+4Znicd/z35j46HdGfSI4xXAyYCevYUJO+ofw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D266548 --- Comment #4 from commit-hook@FreeBSD.org --- A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3D5be5d0d5cb2657d7668f4ca0f8543198c= f8d759b commit 5be5d0d5cb2657d7668f4ca0f8543198cf8d759b Author: Zhenlei Huang AuthorDate: 2022-10-18 15:03:02 +0000 Commit: Mark Johnston CommitDate: 2022-10-18 15:03:02 +0000 geom_part: Check number of GPT entries and size of GPT entry Current specification does not have upper limit of the number of partition entries and the size of partition entry. In 799eac8c3df597179bbb3b078362f3ff03993a1a Andrey V. Elsukov introduced a limit maximum number of GPT entries to 4k, but that is for write routine (gpart create) only. When attaching disks that have large number of GPT entries exceeding the limit, or disks with large size of partition entry, it is still possible to exhaust kernel memory. 1. Reuse the limit of the maximum number of partition entries. 2. Limit the maximum size of GPT entry to 1k. In current specification (2.10) the size of GPT entry is 128 * 2^n while n >=3D 0, and the size - 128 is reserved. 1k should be sufficient enough for foreseen future. PR: 266548 Discussed with: imp Reviewed by: markj MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D36717 sys/geom/part/g_part_gpt.c | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) --=20 You are receiving this mail because: You are the assignee for the bug.=