This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Support for KASLR



> Am 20.03.2018 um 14:22 schrieb Frank Ch. Eigler <fche@redhat.com>:
> 
> 
> Hi, Torsten -
> 
>> [...]
>> I’ve a kernel with the configuration option CONFIG_RANDOMIZE_BASE
>> set. The backtrace fails for the kernel. The patch tries to address
>> this issue. [...]
>> _stext.
> 
> It would surprise for systemtap to need this sort of thing now.  KASLR
> is a years-old technique, and CONFIG_RANDOMIZE_BASE has been default for
> most of that time.  We routinely relocate our internal kernel
> symbol/unwind info with respect to the same _stext symbol.  I wonder
> what is going on.
> 
> - FChE

Hi Frank,

The reason is that the backtrace operation has so many failsafe paths that it works most of the time. ;-)

I double checked my observation. I can confirm that e.g print_backtrace() works fine even with CONFIG_RANDOMIZE_BASE set. What fails in my case is a hack that I had added to one of my systemtap scripts. The script uses the function _stp_stack_kernel_get() without going through _stp_stack_kernel_print(). The call to _stp_stack_kernel_get() succeeds for depth = 0, but fails for greater values. _stp_stack_kernel_print() falls back to _stp_stack_print_fallback() (STP_USE_DWARF_UNWINDER is defined in my configuration).

Kind Regards,
Torsten

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]