From 698773cb4fbe8873ee0a2c37b86caef01e2c6159 Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Thu, 6 Jun 2019 14:10:59 +0200 Subject: sys/linux: don't inherit fd_usb from fd This is a special fd, we don't want various ioctls be called on it. --- sys/linux/gen/386.go | 4 ++-- sys/linux/gen/amd64.go | 4 ++-- sys/linux/gen/arm.go | 4 ++-- sys/linux/gen/arm64.go | 4 ++-- sys/linux/gen/ppc64le.go | 4 ++-- sys/linux/vusb.txt | 4 +++- 6 files changed, 13 insertions(+), 11 deletions(-) (limited to 'sys') diff --git a/sys/linux/gen/386.go b/sys/linux/gen/386.go index 468a83c81..1967b7974 100644 --- a/sys/linux/gen/386.go +++ b/sys/linux/gen/386.go @@ -109,7 +109,7 @@ var resources_386 = []*ResourceDesc{ {Name: "fd_uffd", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_uffd"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, {Name: "fd_uhid", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_uhid"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, {Name: "fd_uinput", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_uinput"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, - {Name: "fd_usb", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_usb"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, + {Name: "fd_usb", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd_usb"}, Values: []uint64{18446744073709551615}}, {Name: "fd_userio", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_userio"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, {Name: "fd_v4l2_buffer", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_v4l2_buffer"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, {Name: "fd_vhci", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_vhci"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, @@ -51305,4 +51305,4 @@ var consts_386 = []ConstValue{ {Name: "bpf_insn_load_imm_dw", Value: 24}, } -const revision_386 = "b573ebe9c055d49064608c5d8e2fbad21d43f0c9" +const revision_386 = "424a5fe965ebbf6871858b76290438939ece5899" diff --git a/sys/linux/gen/amd64.go b/sys/linux/gen/amd64.go index cdc1e4eb0..af83e11a1 100644 --- a/sys/linux/gen/amd64.go +++ b/sys/linux/gen/amd64.go @@ -109,7 +109,7 @@ var resources_amd64 = []*ResourceDesc{ {Name: "fd_uffd", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_uffd"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, {Name: "fd_uhid", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_uhid"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, {Name: "fd_uinput", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_uinput"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, - {Name: "fd_usb", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_usb"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, + {Name: "fd_usb", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd_usb"}, Values: []uint64{18446744073709551615}}, {Name: "fd_userio", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_userio"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, {Name: "fd_v4l2_buffer", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_v4l2_buffer"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, {Name: "fd_vhci", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_vhci"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, @@ -51842,4 +51842,4 @@ var consts_amd64 = []ConstValue{ {Name: "bpf_insn_load_imm_dw", Value: 24}, } -const revision_amd64 = "52a32c5ec09cc1187f3b58872ef188eee5cf45a6" +const revision_amd64 = "ddbf82ada7a52ee8e8786ee48f374b93283916dd" diff --git a/sys/linux/gen/arm.go b/sys/linux/gen/arm.go index 7f9688c0d..d044381f2 100644 --- a/sys/linux/gen/arm.go +++ b/sys/linux/gen/arm.go @@ -109,7 +109,7 @@ var resources_arm = []*ResourceDesc{ {Name: "fd_uffd", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_uffd"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, {Name: "fd_uhid", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_uhid"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, {Name: "fd_uinput", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_uinput"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, - {Name: "fd_usb", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_usb"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, + {Name: "fd_usb", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd_usb"}, Values: []uint64{18446744073709551615}}, {Name: "fd_userio", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_userio"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, {Name: "fd_v4l2_buffer", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_v4l2_buffer"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, {Name: "fd_vhci", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_vhci"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, @@ -50882,4 +50882,4 @@ var consts_arm = []ConstValue{ {Name: "bpf_insn_load_imm_dw", Value: 24}, } -const revision_arm = "09d8fa4f019d76d632d9260756660aaa9737e5d5" +const revision_arm = "119ad8c2d0d27a59585af451149dd221409ba88d" diff --git a/sys/linux/gen/arm64.go b/sys/linux/gen/arm64.go index 8f651ac15..765f17fbd 100644 --- a/sys/linux/gen/arm64.go +++ b/sys/linux/gen/arm64.go @@ -109,7 +109,7 @@ var resources_arm64 = []*ResourceDesc{ {Name: "fd_uffd", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_uffd"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, {Name: "fd_uhid", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_uhid"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, {Name: "fd_uinput", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_uinput"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, - {Name: "fd_usb", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_usb"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, + {Name: "fd_usb", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd_usb"}, Values: []uint64{18446744073709551615}}, {Name: "fd_userio", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_userio"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, {Name: "fd_v4l2_buffer", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_v4l2_buffer"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, {Name: "fd_vhci", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_vhci"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, @@ -51192,4 +51192,4 @@ var consts_arm64 = []ConstValue{ {Name: "bpf_insn_load_imm_dw", Value: 24}, } -const revision_arm64 = "63819d796ff2bc8443767443eced02e91ac4a55b" +const revision_arm64 = "ed0579f96e93ea6e5b3b53e58d48bfd87f5f92a9" diff --git a/sys/linux/gen/ppc64le.go b/sys/linux/gen/ppc64le.go index 346156b1e..7891312cb 100644 --- a/sys/linux/gen/ppc64le.go +++ b/sys/linux/gen/ppc64le.go @@ -109,7 +109,7 @@ var resources_ppc64le = []*ResourceDesc{ {Name: "fd_uffd", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_uffd"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, {Name: "fd_uhid", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_uhid"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, {Name: "fd_uinput", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_uinput"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, - {Name: "fd_usb", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_usb"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, + {Name: "fd_usb", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd_usb"}, Values: []uint64{18446744073709551615}}, {Name: "fd_userio", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_userio"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, {Name: "fd_v4l2_buffer", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_v4l2_buffer"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, {Name: "fd_vhci", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd", "fd_vhci"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, @@ -51159,4 +51159,4 @@ var consts_ppc64le = []ConstValue{ {Name: "bpf_insn_load_imm_dw", Value: 24}, } -const revision_ppc64le = "99b016ed035226cb1c1fbc7c5eab2d204debf38e" +const revision_ppc64le = "5c5ba0ff620fdbc206179a532be9ad76f726f12f" diff --git a/sys/linux/vusb.txt b/sys/linux/vusb.txt index 464cd321f..35a5eaaa5 100644 --- a/sys/linux/vusb.txt +++ b/sys/linux/vusb.txt @@ -10,7 +10,9 @@ include include include -resource fd_usb[fd] +# This is a special fd for USB fuzzing and should only be used with syz_usb_* syzcalls. +# We don't inherit it from the fd resource, to discourage syzkaller calling raw ioctls on it. +resource fd_usb[int32]: -1 syz_usb_connect(speed flags[usb_device_speed], dev_len len[dev], dev ptr[in, usb_device_descriptor], conn_descs ptr[in, vusb_connect_descriptors]) fd_usb syz_usb_control_io(fd fd_usb, descs ptr[in, vusb_descriptors], resps ptr[in, vusb_responses]) -- cgit mrf-deployment