[CRIU] RFC: Add owner user namespace to tty_struct

Matt Brown matt at nmatt.com
Mon May 29 14:14:34 PDT 2017


On 5/29/17 7:22 AM, Cyrill Gorcunov wrote:
> On Mon, May 29, 2017 at 02:09:40PM +0300, Pavel Emelyanov wrote:
>> On 05/29/2017 01:00 PM, Cyrill Gorcunov wrote:
>>> On Mon, May 29, 2017 at 12:43:52PM +0300, Pavel Emelyanov wrote:
>>>>>
>>>>> Hi Matt! Currently we don't use fake input in criu so at moment it won't
>>>>> affect us anyhow, but in longterm I expect more owner_user_ns testing may
>>>>> appear. Thus we will need to know which owner tty belong to. I think we
>>>>> may extend tty_fops and use show_fdinfo method to print owner_user_ns.
>>>>
>>>> We have similar problem with net_device:net pairing and with userns:<any other ns>
>>>> one -- we need to know which object belongs to which. For the net_device:net case
>>>> there has appeared a netdev ioctl, that results in an opened namespace file, just
>>>> like if we did open("/proc/pid/ns/net"). I think the same API would be more convenient
>>>> for tty:userns. All the more so there's already plenty of ioctls for ttys :)
>>>
>>> Mind to point which netdev ioctl it is?
>>
>> It's SIOCGSKNS. And I've made a mistake when told it was netdev->netns, it's
>> socket->netns mapper. Still, it returns an open file :)
> 
> Look good. Yup we could have the same for ttys I think.
> 

Thanks for all the feedback!

I will definitely look into the SIOCGSKNS ioctl and see if I can whip up
something similar for tty->owner_user_ns. In the mean time, do you feel OK with
my patch landing without this since you don't currently do input faking in criu?

Thanks,
Matt Brown


More information about the CRIU mailing list