Reject empty keys in metadata lookups with EINVAL to prevent an infinite loop while holding allprison_lock and pr_mtx.
Add tests for empty-key reads and writes with empty and populated meta/env buffers, trailing newlines, and empty final values.
Details
Details
Run
kyua test -k /usr/tests/sys/kern/Kyuafile jailmeta:keyvalue
Verify empty-key reads and writes return EINVAL without hanging or changing existing metadata, for both meta and env.
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Nice catch! jm_osd_method_set() already has this check for an empty key, while jm_osd_method_get() forgot doing the same.
Thank you for the respective test coverage.