Skip to content

Commit c194dad

Browse files
hcahcaVasily Gorbik
authored andcommitted
s390/extable: fix exception table sorting
s390 has a swap_ex_entry_fixup function, however it is not being used since common code expects a swap_ex_entry_fixup define. If it is not defined the default implementation will be used. So fix this by adding a proper define. However also the implementation of the function must be fixed, since a NULL value for handler has a special meaning and must not be adjusted. Luckily all of this doesn't fix a real bug currently: the main extable is correctly sorted during build time, and for runtime sorting there is currently no case where the handler field is not NULL. Fixes: 05a68e8 ("s390/kernel: expand exception table logic to allow new handling options") Acked-by: Ilya Leoshkevich <iii@linux.ibm.com> Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
1 parent 1389f17 commit c194dad

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

arch/s390/include/asm/extable.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,13 @@ static inline void swap_ex_entry_fixup(struct exception_table_entry *a,
6969
{
7070
a->fixup = b->fixup + delta;
7171
b->fixup = tmp.fixup - delta;
72-
a->handler = b->handler + delta;
73-
b->handler = tmp.handler - delta;
72+
a->handler = b->handler;
73+
if (a->handler)
74+
a->handler += delta;
75+
b->handler = tmp.handler;
76+
if (b->handler)
77+
b->handler -= delta;
7478
}
79+
#define swap_ex_entry_fixup swap_ex_entry_fixup
7580

7681
#endif

0 commit comments

Comments
 (0)