Re: [PATCH 1/2] x86/kprobes: Fix kprobes instruction boudary check with CONFIG_RETHUNK

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 07, 2022 at 10:49:13PM +0900, Masami Hiramatsu wrote:
> On Wed, 7 Sep 2022 14:56:52 +0200
> Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> 
> > On Wed, Sep 07, 2022 at 09:55:21AM +0900, Masami Hiramatsu (Google) wrote:
> > 
> > >  	if (!kallsyms_lookup_size_offset(paddr, NULL, &offset))
> > >  		return 0;
> > >  
> > 
> > One more thing:
> > 
> >   https://lkml.kernel.org/r/20220902130951.853460809@xxxxxxxxxxxxx
> > 
> > can result in negative offsets. The expression:
> > 
> > 	'paddr - offset'
> > 
> > will still get you to +0, but I might not have fully considered things
> > when I wrote that patch.
> 
> Hmm, isn't 'offset' unsigned? If 'paddr - offset' is still available
> to find the function entry address, it is OK to me.

Yeah, but the magic of 2s complement means it doesn't matter ;-)



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux