Describe the bug
It is not clear what the purpose of e.g. 89a64d88e3c7 ("random: do not use jump labels before they are initialized") in the rpi-6.18.y branch is or ever was. That seems to be a forward-port of something that was first applied to the rpi-5.19.y, including Jason's "I would like to pursue fixing this more directly" note.
However, the Fixes commit f5bda35fba61 ("random: use static branch for crng_ready()") was added to mainline as of v5.19-rc1, and already v5.19-rc2 contains the real upstream fix, 60e5b2886b92 ("random: do not use jump labels before they are initialized"). Yet, the rpi-5.19.y branch, which is based on v5.19.17, has an extra copy of that commit, b6e765ba94c9, corresponding to the first version Jason posted, where the hunk in _credit_init_bits is elided (presumably because it was common between the two versions), but b6e765ba94c9 has the hunk in random_init above the latent entropy logic. Try git show -U30 b6e765ba94c9 and it should be clear that something is wrong.
This became somewhat worse from rpi-6.1.y and onwards, since upstream v6.1 contains f62384995e4c ("random: split initialization into early step and later step"). And b6e765ba94c9 seems to have just been forward-ported, where it does match textually in the new random_init_early function, but now it probably makes even less sense there - random_init still contains the hunk from Jason's upstream commit.
So I believe that the extra copy of that commit should be removed from all maintained rpi-* branches.
Steps to reproduce the behaviour
No observable bug, but downstream shouldn't carry such random hunks with no justification added in a core part of the kernel.
Device (s)
Other
System
See bug description.
Logs
No response
Additional context
No response
Describe the bug
It is not clear what the purpose of e.g.
89a64d88e3c7 ("random: do not use jump labels before they are initialized")in the rpi-6.18.y branch is or ever was. That seems to be a forward-port of something that was first applied to the rpi-5.19.y, including Jason's "I would like to pursue fixing this more directly" note.However, the Fixes commit
f5bda35fba61 ("random: use static branch for crng_ready()")was added to mainline as of v5.19-rc1, and already v5.19-rc2 contains the real upstream fix,60e5b2886b92 ("random: do not use jump labels before they are initialized"). Yet, the rpi-5.19.y branch, which is based on v5.19.17, has an extra copy of that commit,b6e765ba94c9, corresponding to the first version Jason posted, where the hunk in_credit_init_bitsis elided (presumably because it was common between the two versions), butb6e765ba94c9has the hunk inrandom_initabove the latent entropy logic. Trygit show -U30 b6e765ba94c9and it should be clear that something is wrong.This became somewhat worse from rpi-6.1.y and onwards, since upstream v6.1 contains
f62384995e4c ("random: split initialization into early step and later step"). Andb6e765ba94c9seems to have just been forward-ported, where it does match textually in the newrandom_init_earlyfunction, but now it probably makes even less sense there -random_initstill contains the hunk from Jason's upstream commit.So I believe that the extra copy of that commit should be removed from all maintained rpi-* branches.
Steps to reproduce the behaviour
No observable bug, but downstream shouldn't carry such random hunks with no justification added in a core part of the kernel.
Device (s)
Other
System
See bug description.
Logs
No response
Additional context
No response