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: exercising current aarch64 kprobe support with systemtap


On 10/06/2016:10:20:37 AM, David Long wrote:
> On 06/10/2016 09:42 AM, Pratyush Anand wrote:
> > On 10/06/2016:01:49:10 AM, David Long wrote:
> > > Attached are incremental diffs I hope will fix the latest systemtap
> > > failures, without abandoning atomic sequence checking.  I'm trying to avoid
> > > the hex constants but I don't think the insn.c functions help in this case.
> > 
> > It will save us from current problem by checking "stp x29,x30,[sp,...]"
> > instruction and returning false if matches. However, we will have to find some
> > way to recognize .word instructions.
> > 
> > * An assembly function may not start with "stp x29,x30,[sp,...]", e.g.
> >   __dma_map_area(), _cpu_resume etc. However, it could be least likely that a
> >   .word instruction exists before start of assembly function and that too
> >   contains a word value which could be misleading.
> > 
> > * But major issue is, what if someone instruments a kprobe at an address which
> >   contains  .word values. Instruction will never hit, so probe function will not
> >   be called, but when real code reads that .word value, it reads a wrong value.
> > 
> 
> I had considered the assembler routine case but my take on it is that all of
> this is just a best effort heuristic attempt to prevent someone from
> kprobe'ing a kernel to death.  I don't hold out any hope for making this
> bullet-proof.  The mode of failure for the atomic sequence is the safer
> choice (rejecting probe registration) so I'm not that worried about the rare
> case of this happening.  Probing inline data doesn't seem like something we
> can protect from, although we now do blacklist some more data sections.

Sure, I agree that we go with what you have suggested. I was just thinking if we
can take it with GCC people to improve it further in future.

> 
> > Can GCC provide some compiler option where .word values are located into a
> > specific area?
> > 
> 
> You can't just go moving the effect of .word directives into a new
> location/section.  As likely as not that data (which could be an actual
> instruction) needs to be exactly where they were put in the source.

Yes, yes, I meant then compiler will have to modify the offset in instruction
using .word data as well, and offcourse offset has limited range, so .word can
be placed only in those limited regions. I do not have any idea about GCC
implementation, so I do not say that this could be the best way of identifying
.word instructions.

~Pratyush


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