Source-Changes-D archive

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

Re: CVS commit: src/sys/kern



On 02.05.2019 02:48, matthew green wrote:
> "Kamil Rytarowski" writes:
>> Module Name:	src
>> Committed By:	kamil
>> Date:		Wed May  1 17:02:40 UTC 2019
>>
>> Modified Files:
>> 	src/sys/kern: sys_ptrace_common.c
>>
>> Log Message:
>> Disallow resuming program with PC=0x0 in ptrace(2)
>>
>> If the address parameter is 0, report error.
>> It's a popular mistake to set Program Counter to 0x0.
>> In certain kernels this is allowable parameter and causes
>> portability issue.
>>
>> Disallow explicitly zeroed PC, instead of triggering
>> a harder to debug crash later.
> 
> VA 0 can be valid executable code on some platforms.
> 
> 
> .mrg.
> 

Is it used as executable for userspace programs for any current port and
any reasonable one?

We forbid NULL pointer dereference on modern ports. It was certainly
used by PDP-11 as there was a special zeroed mask in 0x0 and
dereferencing NULL pointer was returning zero.

There is a special case of PC=(void *)1 to resume in the previous
position and 1 is not much different special case to 0x0.

Setting PC to 0x0 generates harder to debug crashes.

Attachment: signature.asc
Description: OpenPGP digital signature



Home | Main Index | Thread Index | Old Index