kfence: default to dynamic branch instead of static keys mode
Dear stable maintainers,
We propose picking the following 2 patches to 5.15.y:
07e8481d3c38 kfence: always use static branches to guard kfence_alloc() 4f612ed3f748 kfence: default to dynamic branch instead of static keys mode
, which had not been marked for stable initially, but upon re-evaluation conclude that it will also avoid various unexpected behaviours [1], [2] as the use of frequently-switched static keys (at least on x86) is more trouble than it's worth.
[1] https://lkml.kernel.org/r/CANpmjNOw--ZNyhmn-GjuqU+aH5T98HMmBoCM4z=JFvajC913Qg@mail.gmail.com
[2] https://patchwork.kernel.org/project/linux-acpi/patch/2618833.mvXUDI8C0e@kreacher/
While optional, we recommend 07e8481d3c38 as well, as it avoids the dynamic branch, now the default, if kfence is disabled at boot.
The main thing is to make the default less troublesome and be more conservative. Those choosing to enable CONFIG_KFENCE_STATIC_KEYS can still do so, but requires a deliberate opt-in via a config change.
Many thanks,
-- Marco
Greg Kroah-Hartman
maintainerQuoted 15 lines · Marco Elver
Dear stable maintainers,
We propose picking the following 2 patches to 5.15.y:
07e8481d3c38kfence: always use static branches to guardkfence_alloc()4f612ed3f748kfence: default to dynamic branch instead of static keys mode, which had not been marked for stable initially, but upon re-evaluation conclude that it will also avoid various unexpected behaviours [1], [2] as the use of frequently-switched static keys (at least on x86) is more trouble than it's worth.
[1] https://lkml.kernel.org/r/CANpmjNOw--ZNyhmn-GjuqU+aH5T98HMmBoCM4z=JFvajC913Qg@mail.gmail.com
[2] https://patchwork.kernel.org/project/linux-acpi/patch/2618833.mvXUDI8C0e@kreacher/
Quoted 6 lines
While optional, we recommend
07e8481d3c38as well, as it avoids the dynamic branch, now the default, if kfence is disabled at boot.The main thing is to make the default less troublesome and be more conservative. Those choosing to enable
CONFIG_KFENCE_STATIC_KEYScan still do so, but requires a deliberate opt-in via a config change.
Both now queued up, thanks.
greg k-h