[jdk17u-dev] RFR: 8282144: RandomSupport.convertSeedBytesToLongs sign extension overwrites previous bytes
duke
duke at openjdk.org
Tue Jul 8 15:25:46 UTC 2025
On Wed, 2 Jul 2025 18:01:51 GMT, Daniel Huang <duke at openjdk.org> wrote:
> Backport for RandomSupport issue. There is a loss of information when using `convertSeedBytesToLongs()` with a bad seed, causing a lot of the original bytes to be overwritten by 1s. The fix involves using a bitwise AND with the seed before distributing the seed bytes into the result.
>
> Note there is an exact same issue/bugfix with `convertSeedBytesToInts()`, but I will backport that bugfix separately
>
> Clean backport, ran GHA sanity checks and locally tested tier1, tier2. In tier2, there were 2 failures:
> `test/jdk/java/nio/channels/DatagramChannel/SendReceiveMaxSize.java`
> `test/jdk/java/nio/channels/FileChannel/directio/DirectIOTest.java`
> However, these both failed before the backport as well.
>
> The backport also includes the test for this issue `T8282144.java`, which passes.
@dtmhuang
Your change (at version 664cef110a3aa48fa9441487e68f3a94d22316bd) is now ready to be sponsored by a Committer.
-------------
PR Comment: https://git.openjdk.org/jdk17u-dev/pull/3698#issuecomment-3049392057
More information about the jdk-updates-dev
mailing list