Skip to content

nvpair: i_get_value_size() string array handling tweak - #18877

Open
ryao wants to merge 1 commit into
openzfs:masterfrom
ryao:i_get_value_size-fix
Open

nvpair: i_get_value_size() string array handling tweak#18877
ryao wants to merge 1 commit into
openzfs:masterfrom
ryao:i_get_value_size-fix

Conversation

@ryao

@ryao ryao commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Motivation and Context

The strnlen() function needs to be given the length of the remaining
region to behave as intended, but it was given the length of the total
region on packed strings.

Description

We tighten max_size on packed strings, so that strnlen() works as expected.

Grok 4.5 Build Beta found this bug.

How Has This Been Tested?

The buildbot can test it.

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Quality assurance (non-breaking change which makes the code more robust against bugs)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist

The strnlen() function needs to be given the length of the remaining
region to behave as intended, but it was given the length of the total
region on packed strings.

Reported-by: Grok 4.5 Build Beta
Signed-off-by: Richard Yao <richard@ryao.dev>
@ryao
ryao force-pushed the i_get_value_size-fix branch from 257d3aa to b9689ff Compare August 1, 2026 02:13
@behlendorf
behlendorf requested a review from tonyhutter August 5, 2026 00:02
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