‹ BackHN Continuity

Thread

AMD's random number generator can't generate a 0?

288 points · 220 comments · BruceEel

  1. jstanley · · focus · HN ↗
    This is not the first RNG bug on Zen 2, I recall after I first got mine that some application or other would quit immediately at startup because rdrand always returned -1, i.e. all 1s. It was fixed with a microcode update.

    Do we now learn that they fixed "always generate all 1s" with "never generate all 0s"??

    EDIT: I've been unable to reproduce the problem on my CPU, FWIW. It's a Ryzen 5 3600.

    EDIT2: OK, update, I can reproduce it with rdrand16, rdrand32 is fine but rdrand16 can never generate all 0s. So my CPU does have this problem!

    1. yk · · focus · HN ↗

          return 4 # Determined by fair dice roll.
      1. Gander5739 · · focus · HN ↗
        <a href="https:&#x2F;&#x2F;xkcd.com&#x2F;221&#x2F;" rel="nofollow">https:&#x2F;&#x2F;xkcd.com&#x2F;221&#x2F; for those not in the know
        1. lathiat · · focus · HN ↗
          And for the full fail story behind it, fail0verflow hacking the PS3 presentation is great and covers the bug: <a href="https:&#x2F;&#x2F;youtu.be&#x2F;DUGGJpn2_zY" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;DUGGJpn2_zY

          Most of the console hacking talks are great, both informative and entertaining.

          1. einsteinx2 · · focus · HN ↗
            This comic predates that presentation, in fact they use it in their slide deck at 39:00 in your linked video.

            That presentation is awesome though, worth a watch either way!

            1. adastra22 · · focus · HN ↗
              The comic postdates the PS3 DRM bug and jailbreak by many, many years.
              1. Liquid_Fire · · focus · HN ↗
                That seems impossible (unless maybe you meant to write &quot;predates&quot;, and even then it seems to only be about 3 years).

                The comic was published on 9 February 2007 [0].

                The PS3 was first released in November 2006. I haven&#x27;t watched the video yet, but its description says &quot;2010 saw the first hacks for the Playstation 3&quot;.

                [0] <a href="https:&#x2F;&#x2F;xkcd.com&#x2F;221&#x2F;info.0.json" rel="nofollow">https:&#x2F;&#x2F;xkcd.com&#x2F;221&#x2F;info.0.json

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.