tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Enhance ptyfs to handle multiple instances.



On 14.03.2014 17:51, Christos Zoulas wrote:
> On Mar 14,  5:29pm, netbsd%izyk.ru@localhost (Ilya Zykov) wrote:
> -- Subject: Re: Enhance ptyfs to handle multiple instances.
> 
> | Ok.
> | 
> | 1. The main problem and question in this project(IMHO), it's how get access 
> for every instance through one driver ptm[x].
> |     First version.
> | We can do it as well "Linux devpts" do. Inside every ptyfs we can create 
> not only slave side files,
> | but ptm[x] too for this instance. But who must create(kernel mount function 
> or userspace helper) and what permissions will assign?
> 
> We first need to decide if disclosing gaps in the pty number is a security
> issue. If not, it is simple; we just allocate the next free one and we don't
> care about gaps. I.e. first mount can grab 0,1,2,3,5,6 second mount can grab
> 4,7,8 etc. 

It introduces limits.

>If we care, we can use an indirect mapping. I don't think that we
> care. I don't think that putting ptmx inside devpts makes sense. 

We can easy differentiate ptyfs instance.

>OTOH, we
> could have multiple ptmx devices with different minor numbers and use that
> as the differentiating factor for the pty devices. 

Sorry my tongue-tie, maybe you don't understand me correctly, but this is my 
(One more version).

> I think that's too complex
> and probably not worth it (at least in the first pass).
> 
> |     One more version. 
> | We can do many ptm[x] minor numbers(165:0 165:1 for first instance, 165:2 
> 165:3 for second ...) this can be anywhere in fs.
> | But then for every mount we must pass for what instance it's mount doing. 
> We can do it with new mount option "instance=#"(for example).
> | Every version has advantages and disadvantage. I think first version more 
> clear. What do you think?
> 
> I think that this is not very desirable because it again introduces limits
> to the number of ptys per mountpoint.

I don't understand how?

> 
> | 2. Mount without new option "minstance"(for example) must keep old 
> behavior. Is it necessarily?
> | Or every new mount will mount new instance?
> 
> Sure, I don't have a problem with that. An option to mount a copy as opposed
> to a separate instance is fine.

Ok.
One remark: mount one instance more than one time useless, because, which mount 
point must return TIOCPTMGET in this case?
Maybe I don't understand fully NetBSD pty layer realization yet.

> 
> christos
> 
> 



Home | Main Index | Thread Index | Old Index