In MAC_POLICY_EXTERNALIZE, the buffer length is used to create a
fixed-size sbuf. When creating such an sbuf, the code has a minimum
buffer size of 2. Thus, filter smaller buffers out when performing
validation.
Details
Details
- Reviewers
rwatson delphij - Group Reviewers
secteam - Commits
- rS337031: Require that MAC label buffers be able to store a non-empty string.
Peter found the bug while doing syscall fuzz testing.
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/security/mac/mac_framework.c | ||
---|---|---|
590 ↗ | (On Diff #46108) | LGTM as-is. If I was you I'd probably use sizeof("") in place of 1 because it would imply that the buffer would hold a nul-terminated string. |