-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove pkg/symlink from docker/docker and use cyphar/filepath-securejoin #1622
Remove pkg/symlink from docker/docker and use cyphar/filepath-securejoin #1622
Conversation
7cb524b
to
4f90e1a
Compare
If we're gonna stop using the upstream |
Switching to https://github.com/cyphar/filepath-securejoin looks OK to me. |
I'll update using it 👼 |
I can work up a PR to switch Docker to use |
9341f36
to
41216d9
Compare
There's still a reference to |
ah yep 😱 |
b59dfbf
to
cfba712
Compare
oh @cyphar.. some unit-tests are failing 😅 |
/me will review. |
@@ -240,7 +240,7 @@ func mountToRootfs(m *configs.Mount, rootfs, mountLabel string) error { | |||
// any previous mounts can invalidate the next mount's destination. | |||
// this can happen when a user specifies mounts within other mounts to cause breakouts or other | |||
// evil stuff to try to escape the container's rootfs. | |||
if dest, err = symlink.FollowSymlinkInScope(dest, rootfs); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The correct ordering of arguments would be:
if dest, err = securejoin.SecureJoin(rootfs, m.Destination); err != nil {
However it feels like this section would be a better place to fix:
164 var (
165 dest = m.Destination
166 )
167 if !strings.HasPrefix(dest, rootfs) {
168 dest = filepath.Join(rootfs, dest)
169 }
And then the two calls for symlink.FollowSymlinkInScope
shouldn't be necessary.
/cc @crosbymichael
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ohhh 😅
@vdemeester can you update the PR description to match the updated change? |
@thaJeztah oh right 👍 |
Yeah, just to be clear: |
runc shouldn't depend on docker and be more self-contained. Removing github.com/pkg/symlink dep is the first step to not depend on docker anymore Signed-off-by: Vincent Demeester <[email protected]>
cfba712
to
5945014
Compare
@cyphar updated 👼 |
runc
shouldn't depend on docker and be more self-contained — removing github.com/pkg/symlink dep is the first step to not depend on docker anymore.The next one is
pkg/mount
👼/cc @jhowardmsft @crosbymichael @hqhq @mrunalp