Skip to contentSkip to conversation

Patch "Revert "LoongArch: Remove unnecessary checks for ORC unwinder"" has been added to the 6.12-stable tree

DISCUSSION Huacai Chen 1 participant 1 message Apr 8 1 message not in the archive Stable branch

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi, Sasha,

Quoted 8 lines · Sasha Levin

This is a note to let you know that I've just added the patch titled

Revert "LoongArch: Remove unnecessary checks for ORC unwinder"

to the 6.12-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

Quoted 7 lines

The filename of the patch is:
revert-loongarch-remove-unnecessary-checks-for-orc-u.patch
and it can be found in the queue-6.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

We only need to revert "LoongArch/orc: Use RCU in all users of __module_address()", and this patch can be applied by adjusting one line context.

Huacai

Quoted 55 lines

commit 3d853399df67f50d070f6ba643d69894ee9d0986

Author: Sasha Levin <[email protected]>
Date:   Tue Apr 7 20:00:57 2026 -0400

Revert "LoongArch: Remove unnecessary checks for ORC unwinder"

This reverts commit 5d8e3b81aee2c18610c5f440936f0bf3b6426e56.

arch/loongarch/kernel/unwind_orc.c +11 -5
index 4924d1ecc4579..59809c3406c03 100644
@@ -359,6 +359,12 @@ static inline unsigned long bt_address(unsigned long ra)
 {
        extern unsigned long eentry;
 
+       if (__kernel_text_address(ra))
+               return ra;
+
+       if (__module_text_address(ra))
+               return ra;
+
        if (ra >= eentry && ra < eentry +  EXCCODE_INT_END * VECSIZE) {
                unsigned long func;
                unsigned long type = (ra - eentry) / VECSIZE;
@@ -376,13 +382,10 @@ static inline unsigned long bt_address(unsigned long ra)
                        break;
                }
 
-               ra = func + offset;
+               return func + offset;
        }
 
-       if (__kernel_text_address(ra))
-               return ra;
-
-       return 0;
+       return ra;
 }
 
 bool unwind_next_frame(struct unwind_state *state)
@@ -508,6 +511,9 @@ bool unwind_next_frame(struct unwind_state *state)
                goto err;
        }
 
+       if (!__kernel_text_address(state->pc))
+               goto err;
+
        return true;
 
 err: