-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"_stext hash changed unexpectedly" when loading at boot on RHEL8 #295
Comments
The above is with |
This issue does not occur so far on Rocky Linux 9 with |
IIRC, an older version of LKRG worked correctly on |
Can you get the list of commit changes from Rocky Linux? |
The individual kernel commits are not exposed by RHEL anymore, but there's this in changelog:
There were many more lines in these changelog entries - I kept here only those I thought were potentially relevant. The issue looks similar to #256, and it appears that our fix for that one is wrong for recent RHEL 8. Indeed, it'd treat any 8.x the same as anything below 9.1, so we wouldn't adjust to a back-port only made e.g in 8.8. Diff'ing -348 vs. -477, so 8.5 to 8.8, I see that It is possible that the fix for #256 was buggy right away. Adam, you wrote that you "verified RHEL 8.6, 8.7, 9.0 and 9.1 and the current logic seems to work fine", but since we're dealing with races I'm not convinced nothing actually broke on 8.6 and 8.7. I don't know whether your testing included installation of LKRG to be loaded at system bootup? |
A new 'text_poke_loc' was backported to RHEL 8.8+. This commit brings the support for such kernels as well as addresses the lkrg-org#295 problem.
I generated these diffs between RHEL8 kernel revisions:
These correspond to the range from 8.5 to 8.8. In there,
In other words, it's possibly changed between 8.5 and 8.6, and then again between 8.7 and 8.8. The 8.5 to 8.6 change removes --- x348.23.1/linux-4.18.0-348.23.1.el8_5/arch/x86/include/asm/text-patching.h 2022-04-12 15:30:37.000000000 +0200
+++ x372.32.1/linux-4.18.0-372.32.1.el8_6/arch/x86/include/asm/text-patching.h 2022-10-07 16:45:37.000000000 +0200
@@ -25,14 +25,6 @@ static inline void apply_paravirt(struct
*/
#define POKE_MAX_OPCODE_SIZE 5
-struct text_poke_loc {
- void *addr;
- int len;
- s32 rel32;
- u8 opcode;
- const u8 text[POKE_MAX_OPCODE_SIZE];
-}; --- x348.23.1/linux-4.18.0-348.23.1.el8_5/arch/x86/kernel/alternative.c 2022-04-12 15:30:37.000000000 +0200
+++ x372.32.1/linux-4.18.0-372.32.1.el8_6/arch/x86/kernel/alternative.c 2022-10-07 16:45:37.000000000 +0200
[...]
+struct text_poke_loc {
+ s32 rel_addr; /* addr := _stext + rel_addr */
+ s32 rel32;
+ u8 opcode;
+ const u8 text[POKE_MAX_OPCODE_SIZE];
+}; The 8.7 to 8.8 change is: struct text_poke_loc {
- s32 rel_addr; /* addr := _stext + rel_addr */
- s32 rel32;
+ /* addr := _stext + rel_addr */
+ s32 rel_addr;
+ s32 disp;
+ u8 len;
u8 opcode;
const u8 text[POKE_MAX_OPCODE_SIZE];
+ /* see text_poke_bp_batch() */
+ u8 old;
}; |
A new 'text_poke_loc' was backported to RHEL 8.8+. This commit brings the support for such kernels as well as addresses the #295 problem.
This appears fixed by #296, so I'll close. We can reopen if needed. |
For a package of LKRG 0.9.7 built with our RPM spec file here on a RHEL 8 rebuild (package built for Rocky 8, loaded on Alma 8), after
systemctl enable lkrg
andreboot
, with an edit to/etc/sysctl.d/01-lkrg.conf
to prevent the panic:and then these keep repeating. Unloading and reloading LKRG makes them go away. In my testing so far, this occurs only when LKRG is loaded at boot.
I think this is a different problem than #269 because this VM has only one vCPU (and is x86_64, but that might not be relevant).
The text was updated successfully, but these errors were encountered: