[CRIU] [PATCH 2/6] Skip generating iov for non PROT_READ region

abhishek dubey dubeyabhishek777 at gmail.com
Fri Aug 2 09:13:21 MSK 2019


On 30/07/19 6:07 PM, Pavel Emelianov wrote:
> On 7/25/19 4:13 AM, Abhishek Dubey wrote:
>> skip iov-generation for regions not having PROT_READ,
>> since process_vm_readv syscall fail to process such regions
>>
>> Signed-off-by: Abhishek Dubey <dubeyabhishek777 at gmail.com>
>> ---
>>   criu/mem.c | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/criu/mem.c b/criu/mem.c
>> index a7e8d0b..5c13690 100644
>> --- a/criu/mem.c
>> +++ b/criu/mem.c
>> @@ -361,6 +361,12 @@ static int generate_vma_iovs(struct pstree_item *item, struct vma_area *vma,
>>   				!vma_area_is(vma, VMA_ANON_SHARED))
>>   		return 0;
>>   
>> +	if (!(vma->e->prot & PROT_READ)) {
>> +		if (pre_dump)
>> +			return 0;
>> +		has_parent = false;
> Why setting this to false in this case?

Same function is used for generating iov for pre-dump and dump.

When a vma don't have PROT_READ flag set, such vma must not be listed, 
since process_vm_readv() syscall can't process

such mappings so they are skipped from adding in iovec.

When same function prepare iov for dump stage and a vma don't have 
PROT_READ flag, this iov was never drained in previous

pre-dump(s) (due to reason mentioned above), therefore setting the 
parent to false.

>
>> +	}
>> +
>>   	if (vma_entry_is(vma->e, VMA_AREA_AIORING)) {
>>   		if (pre_dump)
>>   			return 0;
>>
-Abhishek


More information about the CRIU mailing list