Message ID | 1594283025-4166-1-git-send-email-sanggil2.kim@samsung.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | arm64: kernel: Add module symbols _text, _etext. | expand |
On Thu, Jul 09, 2020 at 05:23:45PM +0900, sanggil2.kim@samsung.com wrote: > From: Sanggil Kim <sanggil2.kim@samsung.com> > > We have a solution to protect kernel code section(autually from _text to > _etext) by not MMU. In order to do this, we have to know the addresses > of _text and _etext at runtime. Interesting! Can you post patches so that we can implement this solution upstream? Without an in-tree user, we won't be exporting these symbols. Thanks, Will
On Thu, Jul 09, 2020 at 10:49:51AM +0100, Will Deacon wrote: > On Thu, Jul 09, 2020 at 05:23:45PM +0900, sanggil2.kim@samsung.com wrote: > > From: Sanggil Kim <sanggil2.kim@samsung.com> > > > > We have a solution to protect kernel code section(autually from _text to > > _etext) by not MMU. In order to do this, we have to know the addresses > > of _text and _etext at runtime. > > Interesting! Can you post patches so that we can implement this solution > upstream? Without an in-tree user, we won't be exporting these symbols. And even with that I'm pretty sure the code doing the 'protection' should be built-in and not modular..
diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S index 037421c..09b405e 100644 --- a/arch/arm64/kernel/head.S +++ b/arch/arm64/kernel/head.S @@ -1003,3 +1003,6 @@ SYM_FUNC_START_LOCAL(__primary_switch) adrp x0, __PHYS_OFFSET br x8 SYM_FUNC_END(__primary_switch) + +EXPORT_SYMBOL(_text) +EXPORT_SYMBOL(_etext)