Re: sigsegv/sigbus not setting si_addr correctly for insn faults

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

 



Am 28.02.2015 um 22:24 schrieb Mike Frysinger:
> when running strace tests, we noticed that si_addr appears to be wrong.  the 
> attached test shows the problem -- si_addr isn't set to the faulting address.
> 
> i hacked arch/s390/mm/fault.c:do_sigsegv to load regs->psw.addr (sans mask),
> and it worked for insn based crashes.  but obviously that doesn't work for
> data based ones.  i'm not familiar with how regs->int_parm_long works though,
> so maybe it's supposed to be loaded indirectly.  the use of __FAIL_ADDR_MASK
> blindly is most certainly incorrect ...
> 
> whatever the fix, do_sigbus probably needs it too.


The problem is that all faults on s390 give the address only on page
granularity (HW-wise)
e.g. if you use 0x123456 as fail address you get si_addr == 0x123000


> 
> on x86_64, both work:
> $ gcc test.c -O3
> $ ./a.out 
> data crash
> received signal 11
> si_addr 0xa0
> crasher 0xa0
> PASS
> $ ./a.out asdf
> text crash
> received signal 11
> si_addr 0xa0
> crasher 0xa0
> PASS
> 
> on s390 both fail:
> $ gcc test.c -O3
> $ ./a.out 
> data crash
> received signal 11
> si_addr (nil)
> crasher 0xa0
> FAIL
> $ ./a.out asdf
> text crash
> received signal 11
> si_addr (nil)
> crasher 0xa0
> FAIL
> 
> -mike
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-s390" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux