Merge pull request #4556 from cyphar/1.2-readd-tuntap

[1.2] Re-add tun/tap to default device rules
This commit is contained in:
Kir Kolyshkin
2024-12-16 21:51:09 -08:00
committed by GitHub
2 changed files with 30 additions and 6 deletions
@@ -120,14 +120,21 @@ block-8:
51: MovImm32 dst: r0 imm: 1
52: Exit
block-9:
// /dev/pts (c, 136, wildcard, rwm, true)
// tuntap (c, 10, 200, rwm, true)
53: JNEImm dst: r2 off: -1 imm: 2 <block-10>
54: JNEImm dst: r4 off: -1 imm: 136 <block-10>
55: MovImm32 dst: r0 imm: 1
56: Exit
54: JNEImm dst: r4 off: -1 imm: 10 <block-10>
55: JNEImm dst: r5 off: -1 imm: 200 <block-10>
56: MovImm32 dst: r0 imm: 1
57: Exit
block-10:
57: MovImm32 dst: r0 imm: 0
58: Exit
// /dev/pts (c, 136, wildcard, rwm, true)
58: JNEImm dst: r2 off: -1 imm: 2 <block-11>
59: JNEImm dst: r4 off: -1 imm: 136 <block-11>
60: MovImm32 dst: r0 imm: 1
61: Exit
block-11:
62: MovImm32 dst: r0 imm: 0
63: Exit
`
var devices []*devices.Rule
for _, device := range specconv.AllowedDevices {
+17
View File
@@ -315,6 +315,23 @@ var AllowedDevices = []*devices.Device{
Allow: true,
},
},
// The following entry for /dev/net/tun device was there from the
// very early days of Docker, but got removed in runc 1.2.0-rc1,
// causing a number of regressions for users (see
// https://github.com/opencontainers/runc/pull/3468).
//
// Some upper-level orcherstration tools makes it either impossible
// or cumbersome to supply additional device rules, so we have to
// keep this for the sake of backward compatibility.
{
Rule: devices.Rule{
Type: devices.CharDevice,
Major: 10,
Minor: 200,
Permissions: "rwm",
Allow: true,
},
},
}
type CreateOpts struct {