]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
csprng: fix undefined behavior in entropy pool initialization
authorTulio A M Mendes <[email protected]>
Thu, 11 Jun 2026 03:05:21 +0000 (00:05 -0300)
committerTulio A M Mendes <[email protected]>
Thu, 11 Jun 2026 03:05:21 +0000 (00:05 -0300)
commit606e105f49c06f5cdc3b87ced6097959cdaf405b
tree7f6bcc464dcd55a829adb306a6a48e14ce54f771
parent19a69035a4f55408775ae45e632eea0481342eca
csprng: fix undefined behavior in entropy pool initialization

Fixed cppcheck error: shifting 64-bit value by 504 bits is undefined.
The TSC has only 64 bits (8 bytes), but the loop was iterating 64 times.
Changed to extract only 8 bytes from TSC and fill remaining pool with
tick count variations.

Test: make test-all PASS (131/131 smoke, 38/38 analyzer, 111/111 host)
src/kernel/csprng.c