freebsd-dev/sys/geom/part
Zhenlei Huang 5be5d0d5cb 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
799eac8c3d 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 >= 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
2022-10-18 11:03:02 -04:00
..
g_part_apm.c Make MAXPHYS tunable. Bump MAXPHYS to 1M. 2020-11-28 12:12:51 +00:00
g_part_bsd64.c sys/geom: Use C99 fixed-width integer types. 2021-12-28 09:41:51 -08:00
g_part_bsd.c
g_part_ebr.c geom: clean up empty lines in .c and .h files 2020-09-01 22:14:09 +00:00
g_part_gpt.c geom_part: Check number of GPT entries and size of GPT entry 2022-10-18 11:03:02 -04:00
g_part_if.m gpart(8): Fix two typos in source code comments 2022-03-28 19:36:48 +02:00
g_part_ldm.c Make MAXPHYS tunable. Bump MAXPHYS to 1M. 2020-11-28 12:12:51 +00:00
g_part_mbr.c gpart: Move MBR efimedia reporting to a separate routine 2021-11-02 17:09:17 -06:00
g_part_vtoc8.c Use snprintf instead of sprintf. 2020-07-26 01:45:26 +00:00
g_part.c geom: Add HiFive boot partitions 2022-01-26 10:54:45 -05:00
g_part.h geom: Add HiFive boot partitions 2022-01-26 10:54:45 -05:00