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
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 18458 Build 18163: arc lint + arc unit
Event Timeline
sys/security/mac/mac_framework.c | ||
---|---|---|
590 | 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. |