Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Oct 2022 15:20:35 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 266548] malicious gpt can cause kernel page fault during tasting
Message-ID:  <bug-266548-227-k35rpOF24L@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-266548-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-266548-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <zlei.huang@gmail.com>
AuthorDate: 2022-10-18 15:03:02 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
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.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-266548-227-k35rpOF24L>