[CRIU] [PATCH 2/2 v4] fsnotify: Always provide the path for inotify watchees

Pavel Emelyanov xemul at parallels.com
Mon Oct 19 04:27:28 PDT 2015


On 10/19/2015 02:17 PM, Cyrill Gorcunov wrote:
> On Mon, Oct 19, 2015 at 02:05:32PM +0300, Pavel Emelyanov wrote:
>>>
>>> This comes from the handle itself, that's how they work. They're
>>
>> No, no, no :) I'm talking about this
>>
>>> +		openable_fd = openat(mntfd, __path, O_PATH);
>>> +		if (openable_fd >= 0) {
>>> +			close(openable_fd);
>>
>> code. You open _some_ path and state that the inode you get after
>> this is the same as you got before with open_by_handle_at(). I say
>> this assumption is wrong and should be checked by comparing inodes.
> 
> OK, I see what you mean. If the path opened by handle then read
> from the self-link would not match the inode the whole complete
> kernel is broken. 

No, it's not about the kernel. Let's imagine the openat() fails with
ENOENT. Can it? I guess it can, you try openat() in a loop. Now what
if someone create _another_ file making the openat() that failed
succeed. What you end up with? Wrong file opened by path.

> But sure, I'll add this test :-)
> .
> 



More information about the CRIU mailing list