mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
altcall: fix __alt_call_maybe_initdata so it's safe for livepatch
Setting alternative call variables as __init is not safe for use with livepatch, as livepatches can rightfully introduce new alternative calls to structures marked as __alt_call_maybe_initdata (possibly just indirectly due to replacing existing functions that use those). Attempting to resolve those alternative calls then results in page faults as the variable that holds the function pointer address has been freed. When livepatch is supported use the __ro_after_init attribute instead of __initdata for __alt_call_maybe_initdata. Fixes:f26bb28594('xen: Implement xen/alternative-call.h for use in common code') Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> master commit:af4cd0a6a6master date: 2024-04-11 18:51:36 +0100
This commit is contained in:
1 parent
ae19cd743c
commit
8d1c36d25a
1 file changed
+6
-1
@@ -50,7 +50,12 @@
|
||||
|
||||
#include <asm/alternative.h>
|
||||
|
||||
#define __alt_call_maybe_initdata __initdata
|
||||
#ifdef CONFIG_LIVEPATCH
|
||||
/* Must keep for livepatches to resolve alternative calls. */
|
||||
# define __alt_call_maybe_initdata __ro_after_init
|
||||
#else
|
||||
# define __alt_call_maybe_initdata __initdata
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
|
||||