Skip to content

Ignore changing /dev/null permissions if used in STDIO#289

Merged
mrunalp merged 1 commit intoopencontainers:masterfrom
crosbymichael:stdio-null
Sep 22, 2015
Merged

Ignore changing /dev/null permissions if used in STDIO#289
mrunalp merged 1 commit intoopencontainers:masterfrom
crosbymichael:stdio-null

Conversation

@crosbymichael
Copy link
Copy Markdown
Member

Whenever dev/null is used as one of the main processes STDIO, do not try
to change the permissions on it via fchown because we should not do it
in the first place and also this will fail if the container is supposed
to be readonly.

Signed-off-by: Michael Crosby [email protected]

@codido
Copy link
Copy Markdown
Contributor

codido commented Sep 22, 2015

Was just about to push a patch to address the same issue (https://github.com/gitido/runc/commit/cbd3fe7c2488c8f17f0b11de69bc80a8c374bedf), but took a different approach.

Just wondering if changing permissions of any device file is desirable, not just /dev/null.
In any case, for /dev/null, I guess both fixes should work.

@crosbymichael
Copy link
Copy Markdown
Member Author

@GitIdo what about when things are /dev/pts/1?

stat /dev/pts/1
  File: ‘/dev/pts/1’
  Size: 0               Blocks: 0          IO Block: 1024   character special file
Device: dh/13d  Inode: 4           Links: 1     Device type: 88,1
Access: (0620/crw--w----)  Uid: ( 1000/ michael)   Gid: (    5/     tty)
Access: 2015-09-22 12:32:39.794966534 -0700
Modify: 2015-09-22 12:32:39.794966534 -0700
Change: 2015-09-22 10:25:04.794966534 -0700

@codido
Copy link
Copy Markdown
Contributor

codido commented Sep 22, 2015

@crosbymichael that's a good question.

Not sure we'd want to change ownership there either however - it could have some implications on the process owning that pts, couldn't it?

@crosbymichael
Copy link
Copy Markdown
Member Author

@GitIdo i think we would in the case of pts devices because they need to match the perms of the process that will own them.

@codido
Copy link
Copy Markdown
Contributor

codido commented Sep 22, 2015

@crosbymichael just wondering if there aren't any security implications of doing something like this.

I realize that not chowning the pts might break the process in the container, but doing so might have some implications on the host. Question is if libcontainer should be the one taking that decision.

@crosbymichael
Copy link
Copy Markdown
Member Author

@GitIdo it's ok because we make the pty and libcontainer owns it.

@codido
Copy link
Copy Markdown
Contributor

codido commented Sep 22, 2015

@crosbymichael that's true for runc, but not necessarily for other users of libcontainer, no?

@crosbymichael
Copy link
Copy Markdown
Member Author

ping @LK4D4 @mrunalp

@LK4D4
Copy link
Copy Markdown
Contributor

LK4D4 commented Sep 22, 2015

LGTM
too sad that criu was deleted from debian

@crosbymichael
Copy link
Copy Markdown
Member Author

@LK4D4 ahh, i guess we can build from source in the dockerfile then to fix this?

@LK4D4
Copy link
Copy Markdown
Contributor

LK4D4 commented Sep 22, 2015

@crosbymichael Yup, #287

@runcom
Copy link
Copy Markdown
Member

runcom commented Sep 22, 2015

@LK4D4 @crosbymichael I'm finishing a PR to build criu from source just now

@mrunalp
Copy link
Copy Markdown
Contributor

mrunalp commented Sep 22, 2015

LGTM

@mrunalp
Copy link
Copy Markdown
Contributor

mrunalp commented Sep 22, 2015

Are we waiting for the build to come back before merging?

Whenever dev/null is used as one of the main processes STDIO, do not try
to change the permissions on it via fchown because we should not do it
in the first place and also this will fail if the container is supposed
to be readonly.

Signed-off-by: Michael Crosby <[email protected]>
@crosbymichael
Copy link
Copy Markdown
Member Author

i rebased on master so you can run the tests locally

@mrunalp
Copy link
Copy Markdown
Contributor

mrunalp commented Sep 22, 2015

okay

@mrunalp
Copy link
Copy Markdown
Contributor

mrunalp commented Sep 22, 2015

Test passed locally. Merging.

mrunalp pushed a commit that referenced this pull request Sep 22, 2015
Ignore changing /dev/null permissions if used in STDIO
@mrunalp mrunalp merged commit ec20263 into opencontainers:master Sep 22, 2015
@crosbymichael crosbymichael deleted the stdio-null branch September 22, 2015 22:37
stefanberger pushed a commit to stefanberger/runc that referenced this pull request Sep 8, 2017
MAINTAINERS: correct Vish's github account
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants