Skip to content

fix: Limit GPT headerSize to the sector size#84

Merged
kstribrnAmzn merged 1 commit into
FreeRTOS:mainfrom
kstribrnAmzn:gptSectorSize
Jun 24, 2026
Merged

fix: Limit GPT headerSize to the sector size#84
kstribrnAmzn merged 1 commit into
FreeRTOS:mainfrom
kstribrnAmzn:gptSectorSize

Conversation

@kstribrnAmzn

@kstribrnAmzn kstribrnAmzn commented Jun 23, 2026

Copy link
Copy Markdown
Member

Description

GPT sector size is unlimited however the use
of 16-bit integers limit a practical change
to supporting 4096 byte sectors. Luckily this
is a common sector size.

Without this change the code would blindly
trust the given header size value even if
the sector couldn't possibly be that size.

Thanks @Eun0us for help in identifying this miss.

Test Steps

Added unit tests

Checklist:

  • I have tested my changes. No regression in existing tests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request.

Related Issue

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

archigup
archigup previously approved these changes Jun 23, 2026

@archigup archigup left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit history could be cleaned up so we'd be able to rebase this onto main

@kstribrnAmzn

Copy link
Copy Markdown
Member Author

I'll have the commit history cleanup out shortly. Merging in #83 once the checks pass due to my rebase.

GPT sector size is unlimited however the use
of 16-bit integers limit a practical change
to supporting 65KB sectors. Luckily the most
common sector size is 4096. The library should
be good for some time.

Without this change the code would blindly
trust the given header size value even if
the sector couldn't possibly be that size.
@kstribrnAmzn kstribrnAmzn dismissed archigup’s stale review June 24, 2026 18:04

The merge-base changed after approval.

@kstribrnAmzn kstribrnAmzn merged commit 9ca465c into FreeRTOS:main Jun 24, 2026
6 checks passed
@kstribrnAmzn kstribrnAmzn deleted the gptSectorSize branch June 24, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants