[CRIU] [PATCH] zdtm: check permissions for map_files

Pavel Emelyanov xemul at virtuozzo.com
Thu Jul 21 09:18:19 PDT 2016


On 07/19/2016 01:00 AM, Andrew Vagin wrote:
> On Thu, Jul 14, 2016 at 02:23:33PM +0300, Pavel Emelyanov wrote:
>> On 07/13/2016 09:23 PM, Andrey Vagin wrote:
>>> From: Andrew Vagin <avagin at virtuozzo.com>
>>>
>>> They have to be the same before dump and after restore.
>>>
>>> Cc: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
>>> Test-for: b67d37d96fa0 ("proc_parse: fix vma file open mode recognition")
>>> Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
>>
>> Is it instead or in addition to the "zdtm.py: check permissions for memory mappings"?
> 
> in addition

OK, but it doesn't apply on top of it.

>>
>>> ---
>>>  test/zdtm.py | 8 +++++++-
>>>  1 file changed, 7 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/test/zdtm.py b/test/zdtm.py
>>> index 7072b62..0297663 100755
>>> --- a/test/zdtm.py
>>> +++ b/test/zdtm.py
>>> @@ -899,12 +899,18 @@ def get_visible_state(test):
>>>  		last = 0
>>>  		for mp in open("/proc/%s/root/proc/%s/maps" % (test.getpid(), pid)):
>>>  			m = map(lambda x: int('0x' + x, 0), mp.split()[0].split('-'))
>>> +
>>> +                        f = "/proc/%s/root/proc/%s/map_files/%s" % (test.getpid(), pid, mp.split()[0])
>>> +                        if os.access(f, os.F_OK):
>>> +                                st = os.lstat(f)
>>> +                                m.append(oct(st.st_mode))
>>> +
>>>  			if cmaps[last][1] == m[0]:
>>>  				cmaps[last][1] = m[1]
>>>  			else:
>>>  				cmaps.append(m)
>>>  				last += 1
>>> -		maps[pid] = set(map(lambda x: '%x-%x' % (x[0], x[1]), cmaps))
>>> +		maps[pid] = set(map(lambda x: '%x-%x %s' % (x[0], x[1], x[2:]), cmaps))
>>>  
>>>  		cmounts = []
>>>  		try:
>>>
>>
> .
> 



More information about the CRIU mailing list