Skip to content

Commit

Permalink
sys/openbsd: prevent using vio0 as a virtual multicast interface
Browse files Browse the repository at this point in the history
One of the root causes to reported "lost connection to test machine" is
when the egress network interface is being used as a multicast
interface:

  setsockopt$inet6_MRT6_ADD_MIF(r0, 0x29, 0x66, &(0x7f0000000180)={0x2}, 0xc)

Prevent such syscalls from being generated by limiting the range of
allowed interface indices.
  • Loading branch information
mptre authored and dvyukov committed Jun 8, 2019
1 parent cf9c3a5 commit 0159583
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion executor/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@

#if GOARCH_amd64
#define GOARCH "amd64"
#define SYZ_REVISION "046b8d64999817e17f0813efa9e374d2ee520a81"
#define SYZ_REVISION "6255253f9674826c8aeacb80503607f3c81dade2"
#define SYZ_EXECUTOR_USES_FORK_SERVER 1
#define SYZ_EXECUTOR_USES_SHMEM 1
#define SYZ_PAGE_SIZE 4096
Expand Down
4 changes: 2 additions & 2 deletions sys/openbsd/gen/amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ var structDescs_amd64 = []*KeyedStruct{
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "mif6c_mifi", TypeSize: 2}}},
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "mif6c_flags", FldName: "mif6c_flags", TypeSize: 1}}, Vals: []uint64{1}, BitMask: true},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "vifc_threshold", TypeSize: 1}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "mif6c_pifi", TypeSize: 2}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "mif6c_pifi", TypeSize: 2}}, Kind: 2, RangeBegin: 4, RangeEnd: 65535},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 2}}, IsPad: true},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "vifc_rate_limit", TypeSize: 4}}},
}}},
Expand Down Expand Up @@ -2970,4 +2970,4 @@ var consts_amd64 = []ConstValue{
{Name: "__MAP_NOREPLACE", Value: 2048},
}

const revision_amd64 = "046b8d64999817e17f0813efa9e374d2ee520a81"
const revision_amd64 = "6255253f9674826c8aeacb80503607f3c81dade2"
4 changes: 3 additions & 1 deletion sys/openbsd/socket_inet6.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ mif6ctl {
mif6c_mifi int16
mif6c_flags flags[mif6c_flags, int8]
vifc_threshold int8
mif6c_pifi int16
# Do not allow low interface indices since one of them is likely to be the
# egress interface vio0 used on GCE instances during fuzzing.
mif6c_pifi int16[4:0xffff]
vifc_rate_limit int32
}

Expand Down

0 comments on commit 0159583

Please sign in to comment.