Page MenuHomeFreeBSD

Fortuna: trivial static variable cleanup
ClosedPublic

Authored by cem on Aug 29 2018, 4:43 AM.
Tags
None
Referenced Files
F141207283: D16937.id47426.diff
Fri, Jan 2, 9:19 AM
F141204963: D16937.id49352.diff
Fri, Jan 2, 8:29 AM
F141197014: D16937.id.diff
Fri, Jan 2, 6:06 AM
Unknown Object (File)
Wed, Dec 31, 1:38 PM
Unknown Object (File)
Tue, Dec 30, 4:15 PM
Unknown Object (File)
Mon, Dec 29, 10:19 AM
Unknown Object (File)
Mon, Dec 29, 7:08 AM
Unknown Object (File)
Fri, Dec 26, 11:03 AM
Subscribers

Details

Summary

Remove unnecessary use of function-local static variable. 32 bytes is
small enough to live on the stack.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 19258
Build 18871: arc lint + arc unit

Event Timeline

This would increase stack usage for /dev/random read by 32 bytes, but I think it's small enough and make the code easier to reason for MP safety (the buffer is not meant to be shared by two different threads), so consider this a LGTM from secteam@ as long as there is no objection raised by September 1st.

This would increase stack usage for /dev/random read by 32 bytes, but I think it's small enough and make the code easier to reason for MP safety (the buffer is not meant to be shared by two different threads), so consider this a LGTM from secteam@ as long as there is no objection raised by September 1st.

Yeah, the buffer should not be shared and it is a tiny amount of stack space. Our /dev/random read stacks are not super deep. (This isn't a security issue or implementation flaw due to the exclusive RANDOM_RESEED mutex being held over all accesses.) Thanks!

If it doesn't crash anything, then fine! I had stack problems at some point.

This revision is now accepted and ready to land.Aug 29 2018, 7:29 PM
delphij accepted this revision.
delphij added a reviewer: secteam.
This revision was automatically updated to reflect the committed changes.