mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #39612 from tiborvass/cve-2019-14271
Fix CVE-2019-14271 loading of nsswitch based config inside chroot under Glibc
This commit is contained in:
commit
11e48badcb
1 changed files with 9 additions and 0 deletions
|
@ -4,13 +4,22 @@ import (
|
|||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"os"
|
||||
"os/user"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/docker/docker/pkg/archive"
|
||||
"github.com/docker/docker/pkg/idtools"
|
||||
)
|
||||
|
||||
func init() {
|
||||
// initialize nss libraries in Glibc so that the dynamic libraries are loaded in the host
|
||||
// environment not in the chroot from untrusted files.
|
||||
_, _ = user.Lookup("docker")
|
||||
_, _ = net.LookupHost("localhost")
|
||||
}
|
||||
|
||||
// NewArchiver returns a new Archiver which uses chrootarchive.Untar
|
||||
func NewArchiver(idMapping *idtools.IdentityMapping) *archive.Archiver {
|
||||
if idMapping == nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue