[CRIU] [PATCH 2/2] zdtm: test for mlocked area restores if programm have no credentials

Pavel Tikhomirov ptikhomirov at parallels.com
Fri Sep 19 06:35:15 PDT 2014


On 09/19/2014 02:25 PM, Pavel Emelyanov wrote:
> On 09/12/2014 02:39 PM, Pavel Tikhomirov wrote:
>
>> +	test_msg("Setuid to 18943\n");
>> +	ret = setuid(18943);
> This call doesn't drop capabilities.
security_capable -> security_task_fix_setuid -> cap_task_fix_setuid -> 
cap_emulate_setxuid - > cap_clear(new->cap_effective);
>> +	if (ret < 0) {
>> +		err("setuid");
>> +		return -1;
>> +	}
>> +
>> +	test_waitsig();
>> +
>> +	ret = get_smaps_bits((unsigned long)start, &new_flags, &new_madv);
>> +	if (ret < 0)
>> +		return -1;
>> +
>> +	test_msg("Check smaps flags for MAP_LOCKED\n");
>> +	if (new_flags & MAP_LOCKED) {
>> +		pass();
>> +	} else {
>> +		fail("Vma is not locked after c/r\n");
>> +		return -1;
>> +	}
>> +
>> +	return 0;
>> +}
>>

-- 
Best regards, Tikhomirov Pavel
Junior Software Developer || Parallels.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/criu/attachments/20140919/e469cb8d/attachment.html>


More information about the CRIU mailing list