diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2016-01-26 17:48:13 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2016-01-26 17:48:13 +0100 |
| commit | 5dfefdb158e0dedc3741a4c3033eaf446f281e34 (patch) | |
| tree | f18cfd485699e016e396f55220a6a400200a03e1 /sys | |
| parent | 66b440bd178174bcada26e65e321a3ddc0b4eab9 (diff) | |
sys: fix write$tun description
Also remove \r in files.
Diffstat (limited to 'sys')
| -rwxr-xr-x | sys/random.txt | 38 | ||||
| -rw-r--r-- | sys/sys.go | 2 | ||||
| -rwxr-xr-x | sys/tun.txt | 280 |
3 files changed, 161 insertions, 159 deletions
diff --git a/sys/random.txt b/sys/random.txt index 2d1cbf1d6..80ffdda53 100755 --- a/sys/random.txt +++ b/sys/random.txt @@ -1,19 +1,19 @@ -# Copyright 2015 syzkaller project authors. All rights reserved.
-# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
-
-include <linux/random.h>
-
-syz_open_dev$random(dev strconst["/dev/random"], id const[0], flags flags[open_flags]) fd[random]
-syz_open_dev$urandom(dev strconst["/dev/urandom"], id const[0], flags flags[open_flags]) fd[random]
-
-ioctl$RNDGETENTCNT(fd fd[random], cmd const[RNDGETENTCNT], arg ptr[out, int32])
-ioctl$RNDADDTOENTCNT(fd fd[random], cmd const[RNDADDTOENTCNT], arg ptr[in, int32])
-ioctl$RNDADDENTROPY(fd fd[random], cmd const[RNDADDENTROPY], arg ptr[in, rnd_entpropy])
-ioctl$RNDZAPENTCNT(fd fd[random], cmd const[RNDZAPENTCNT], arg ptr[in, int32])
-ioctl$RNDCLEARPOOL(fd fd[random], cmd const[RNDCLEARPOOL], arg ptr[in, int32])
-
-rnd_entpropy {
- entcnt int32
- size len[pool, int32]
- pool array[int8]
-}
+# Copyright 2015 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +include <linux/random.h> + +syz_open_dev$random(dev strconst["/dev/random"], id const[0], flags flags[open_flags]) fd[random] +syz_open_dev$urandom(dev strconst["/dev/urandom"], id const[0], flags flags[open_flags]) fd[random] + +ioctl$RNDGETENTCNT(fd fd[random], cmd const[RNDGETENTCNT], arg ptr[out, int32]) +ioctl$RNDADDTOENTCNT(fd fd[random], cmd const[RNDADDTOENTCNT], arg ptr[in, int32]) +ioctl$RNDADDENTROPY(fd fd[random], cmd const[RNDADDENTROPY], arg ptr[in, rnd_entpropy]) +ioctl$RNDZAPENTCNT(fd fd[random], cmd const[RNDZAPENTCNT], arg ptr[in, int32]) +ioctl$RNDCLEARPOOL(fd fd[random], cmd const[RNDCLEARPOOL], arg ptr[in, int32]) + +rnd_entpropy { + entcnt int32 + size len[pool, int32] + pool array[int8] +} diff --git a/sys/sys.go b/sys/sys.go index b69922db1..f7f4fd1fa 100644 --- a/sys/sys.go +++ b/sys/sys.go @@ -3028,7 +3028,7 @@ func initCalls() { Calls = append(Calls, &Call{ID: 1008, Name: "syz_open_dev$tun", CallName: "syz_open_dev", Ret: ResourceType{TypeCommon: TypeCommon{TypeName: "ret", IsOptional: false}, Kind: ResFD, Subkind: FdTun}, Args: []Type{PtrType{TypeCommon: TypeCommon{TypeName: "dev", IsOptional: false}, Dir: DirIn, Type: StrConstType{TypeCommon: TypeCommon{TypeName: "dev", IsOptional: false}, Val: "/dev/net/tun"}}, ConstType{TypeCommon: TypeCommon{TypeName: "id", IsOptional: false}, TypeSize: 0, Val: uintptr(0)}, FlagsType{TypeCommon: TypeCommon{TypeName: "flags", IsOptional: false}, TypeSize: 0, Vals: []uintptr{0, 1, 2, 1024, 8192, 524288, 64, 16384, 65536, 128, 32768, 262144, 256, 131072, 2048, 2097152, 1052672, 512}}}}) }() func() { - Calls = append(Calls, &Call{ID: 1009, Name: "write$tun", CallName: "write", Ret: LenType{TypeCommon: TypeCommon{TypeName: "ret", IsOptional: false}, Buf: "buf", TypeSize: 0, ByteSize: false}, Args: []Type{ResourceType{TypeCommon: TypeCommon{TypeName: "fd", IsOptional: false}, Kind: ResFD, Subkind: FdTun}, StructType{TypeCommon: TypeCommon{TypeName: "tun_buffer", IsOptional: false}, Fields: []Type{StructType{TypeCommon: TypeCommon{TypeName: "tun_pi", IsOptional: false}, Fields: []Type{FlagsType{TypeCommon: TypeCommon{TypeName: "flags", IsOptional: false}, TypeSize: 4, Vals: []uintptr{1, 2, 4096, 8192, 16384, 32768, 256, 512, 1024, 2048, 4096}}, IntType{TypeCommon: TypeCommon{TypeName: "proto", IsOptional: false}, TypeSize: 2}}}, StructType{TypeCommon: TypeCommon{TypeName: "virtio_net_hdr", IsOptional: false}, Fields: []Type{FlagsType{TypeCommon: TypeCommon{TypeName: "flags", IsOptional: false}, TypeSize: 1, Vals: []uintptr{1, 2}}, FlagsType{TypeCommon: TypeCommon{TypeName: "gsotype", IsOptional: false}, TypeSize: 1, Vals: []uintptr{0, 1, 3, 4, 128}}, IntType{TypeCommon: TypeCommon{TypeName: "hdrlen", IsOptional: false}, TypeSize: 2}, IntType{TypeCommon: TypeCommon{TypeName: "gsosize", IsOptional: false}, TypeSize: 2}, IntType{TypeCommon: TypeCommon{TypeName: "start", IsOptional: false}, TypeSize: 2}, IntType{TypeCommon: TypeCommon{TypeName: "offset", IsOptional: false}, TypeSize: 2}}}}}, LenType{TypeCommon: TypeCommon{TypeName: "count", IsOptional: false}, Buf: "buf", TypeSize: 0, ByteSize: false}}}) + Calls = append(Calls, &Call{ID: 1009, Name: "write$tun", CallName: "write", Args: []Type{ResourceType{TypeCommon: TypeCommon{TypeName: "fd", IsOptional: false}, Kind: ResFD, Subkind: FdTun}, PtrType{TypeCommon: TypeCommon{TypeName: "buf", IsOptional: false}, Type: UnionType{TypeCommon: TypeCommon{TypeName: "tun_buffer", IsOptional: false}, varlen: true, Options: []Type{StructType{TypeCommon: TypeCommon{TypeName: "tun_pi", IsOptional: false}, Fields: []Type{FlagsType{TypeCommon: TypeCommon{TypeName: "flags", IsOptional: false}, TypeSize: 4, Vals: []uintptr{1, 2, 4096, 8192, 16384, 32768, 256, 512, 1024, 2048, 4096}}, IntType{TypeCommon: TypeCommon{TypeName: "proto", IsOptional: false}, TypeSize: 2}, ArrayType{TypeCommon: TypeCommon{TypeName: "data", IsOptional: false}, Type: IntType{TypeCommon: TypeCommon{TypeName: "", IsOptional: false}, TypeSize: 1}, Len: 0}}}, StructType{TypeCommon: TypeCommon{TypeName: "virtio_net_hdr", IsOptional: false}, Fields: []Type{FlagsType{TypeCommon: TypeCommon{TypeName: "flags", IsOptional: false}, TypeSize: 1, Vals: []uintptr{1, 2}}, FlagsType{TypeCommon: TypeCommon{TypeName: "gsotype", IsOptional: false}, TypeSize: 1, Vals: []uintptr{0, 1, 3, 4, 128}}, IntType{TypeCommon: TypeCommon{TypeName: "hdrlen", IsOptional: false}, TypeSize: 2}, IntType{TypeCommon: TypeCommon{TypeName: "gsosize", IsOptional: false}, TypeSize: 2}, IntType{TypeCommon: TypeCommon{TypeName: "start", IsOptional: false}, TypeSize: 2}, IntType{TypeCommon: TypeCommon{TypeName: "offset", IsOptional: false}, TypeSize: 2}, ArrayType{TypeCommon: TypeCommon{TypeName: "data", IsOptional: false}, Type: IntType{TypeCommon: TypeCommon{TypeName: "", IsOptional: false}, TypeSize: 1}, Len: 0}}}}}, Dir: DirIn}, LenType{TypeCommon: TypeCommon{TypeName: "count", IsOptional: false}, Buf: "buf", TypeSize: 0, ByteSize: false}}}) }() func() { Calls = append(Calls, &Call{ID: 1010, Name: "ioctl$TUNGETFEATURES", CallName: "ioctl", Args: []Type{ResourceType{TypeCommon: TypeCommon{TypeName: "fd", IsOptional: false}, Kind: ResFD, Subkind: FdTun}, ConstType{TypeCommon: TypeCommon{TypeName: "cmd", IsOptional: false}, TypeSize: 0, Val: uintptr(2147767503)}, PtrType{TypeCommon: TypeCommon{TypeName: "arg", IsOptional: false}, Type: IntType{TypeCommon: TypeCommon{TypeName: "", IsOptional: false}, TypeSize: 4}, Dir: DirOut}}}) diff --git a/sys/tun.txt b/sys/tun.txt index 8872b3633..df7763de4 100755 --- a/sys/tun.txt +++ b/sys/tun.txt @@ -1,139 +1,141 @@ -# Copyright 2015 syzkaller project authors. All rights reserved.
-# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
-
-include <linux/if_tun.h>
-include <linux/virtio_net.h>
-
-syz_open_dev$tun(dev strconst["/dev/net/tun"], id const[0], flags flags[open_flags]) fd[tun]
-write$tun(fd fd[tun], buf tun_buffer[in], count len[buf]) len[buf]
-
-ioctl$TUNGETFEATURES(fd fd[tun], cmd const[TUNGETFEATURES], arg ptr[out, int32])
-ioctl$TUNSETQUEUE(fd fd[tun], cmd const[TUNSETQUEUE], arg ptr[in, ifreq])
-ioctl$TUNSETIFF(fd fd[tun], cmd const[TUNSETIFF], arg ptr[in, ifreq])
-ioctl$TUNSETIFINDEX(fd fd[tun], cmd const[TUNSETIFINDEX], arg ptr[in, int32])
-ioctl$TUNGETIFF(fd fd[tun], cmd const[TUNGETIFF], arg ptr[in, int32])
-ioctl$TUNSETNOCSUM(fd fd[tun], cmd const[TUNSETNOCSUM], arg ptr[in, int32])
-ioctl$TUNSETPERSIST(fd fd[tun], cmd const[TUNSETPERSIST], arg ptr[in, int32])
-ioctl$TUNSETOWNER(fd fd[tun], cmd const[TUNSETOWNER], arg ptr[in, uid])
-ioctl$TUNSETLINK(fd fd[tun], cmd const[TUNSETLINK], arg ptr[in, int32])
-ioctl$TUNSETOFFLOAD(fd fd[tun], cmd const[TUNSETOFFLOAD], arg ptr[in, int32])
-ioctl$TUNSETTXFILTER(fd fd[tun], cmd const[TUNSETTXFILTER], arg ptr[in, tun_filter])
-ioctl$SIOCGIFHWADDR(fd fd[tun], cmd const[SIOCGIFHWADDR], arg ptr[in, ifreq])
-ioctl$SIOCSIFHWADDR(fd fd[tun], cmd const[SIOCSIFHWADDR], arg ptr[in, ifreq])
-ioctl$TUNGETSNDBUF(fd fd[tun], cmd const[TUNGETSNDBUF], arg ptr[out, int32])
-ioctl$TUNSETSNDBUF(fd fd[tun], cmd const[TUNSETSNDBUF], arg ptr[in, int32])
-ioctl$TUNGETVNETHDRSZ(fd fd[tun], cmd const[TUNGETVNETHDRSZ], arg ptr[out, int32])
-ioctl$TUNSETVNETHDRSZ(fd fd[tun], cmd const[TUNSETVNETHDRSZ], arg ptr[in, int32])
-ioctl$TUNATTACHFILTER(fd fd[tun], cmd const[TUNATTACHFILTER], arg ptr[in, sock_fprog])
-ioctl$TUNDETACHFILTER(fd fd[tun], cmd const[TUNDETACHFILTER], arg ptr[in, int32])
-ioctl$TTUNGETFILTER(fd fd[tun], cmd const[TUNGETFILTER], arg ptr[out, int32])
-
-tun_buffer {
- pi tun_pi[opt]
- hdr virtio_net_hdr[opt]
-}
-
-tun_pi {
- flags flags[ifru_flags, int32]
- proto int16
-}
-
-virtio_net_hdr {
- flags flags[virtio_net_flags, int8]
- gsotype flags[virtio_net_types, int8]
- hdrlen int16
- gsosize int16
- start int16
- offset int16
-}
-
-tun_filter {
- flags flags[ifru_flags, int32]
- count len[addr, int32]
- addr ptr[in, array[int8, 6]]
-}
-
-ifreq {
- name array[int8, 16]
- u ifr_ifru
-}
-
-ifr_ifru [
- addr sockaddr_storage
- flags flags[ifru_flags, int16]
- mtu int32
- map ifmap
- data array[int8, 16]
- setting if_settings
-]
-
-ifmap {
- start int32
- end int32
- base int16
- irq int8
- dma int8
- port int8
-}
-
-if_settings {
- type int32
- size int32
- u ifs_ifsu
-}
-
-ifs_ifsu [
- hdlc ptr[in, raw_hdlc_proto]
- cisco ptr[in, cisco_proto]
- fr ptr[in, fr_proto]
- pvc ptr[in, fr_proto_pvc]
- pvcinfo ptr[in, fr_proto_pvc_info]
- sync ptr[in, sync_serial_settings]
- tel ptr[in, te1_settings]
-]
-
-raw_hdlc_proto {
- encode int16
- parity int16
-}
-
-cisco_proto{
- val int32
- timeout int32
-}
-
-fr_proto {
- t391 int32
- t392 int32
- n391 int32
- n392 int32
- n393 int32
- lmi int16
- dce int16
-}
-
-fr_proto_pvc {
- dlcl int32
-}
-
-fr_proto_pvc_info {
- dlci int32
- master array[int8, 16]
-}
-
-sync_serial_settings {
- rate int32
- type int32
- loop int16
-}
-
-te1_settings {
- rate int32
- type int32
- loop int16
- slot int16
-}
-
-virtio_net_flags = VIRTIO_NET_HDR_F_NEEDS_CSUM, VIRTIO_NET_HDR_F_DATA_VALID
-virtio_net_types = VIRTIO_NET_HDR_GSO_NONE, VIRTIO_NET_HDR_GSO_TCPV4, VIRTIO_NET_HDR_GSO_UDP, VIRTIO_NET_HDR_GSO_TCPV6, VIRTIO_NET_HDR_GSO_ECN
-ifru_flags = IFF_TUN, IFF_TAP, IFF_NO_PI, IFF_ONE_QUEUE, IFF_VNET_HDR, IFF_TUN_EXCL, IFF_MULTI_QUEUE, IFF_ATTACH_QUEUE, IFF_DETACH_QUEUE, IFF_PERSIST, IFF_NOFILTER
+# Copyright 2015 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +include <linux/if_tun.h> +include <linux/virtio_net.h> + +syz_open_dev$tun(dev strconst["/dev/net/tun"], id const[0], flags flags[open_flags]) fd[tun] +write$tun(fd fd[tun], buf ptr[in, tun_buffer], count len[buf]) + +ioctl$TUNGETFEATURES(fd fd[tun], cmd const[TUNGETFEATURES], arg ptr[out, int32]) +ioctl$TUNSETQUEUE(fd fd[tun], cmd const[TUNSETQUEUE], arg ptr[in, ifreq]) +ioctl$TUNSETIFF(fd fd[tun], cmd const[TUNSETIFF], arg ptr[in, ifreq]) +ioctl$TUNSETIFINDEX(fd fd[tun], cmd const[TUNSETIFINDEX], arg ptr[in, int32]) +ioctl$TUNGETIFF(fd fd[tun], cmd const[TUNGETIFF], arg ptr[in, int32]) +ioctl$TUNSETNOCSUM(fd fd[tun], cmd const[TUNSETNOCSUM], arg ptr[in, int32]) +ioctl$TUNSETPERSIST(fd fd[tun], cmd const[TUNSETPERSIST], arg ptr[in, int32]) +ioctl$TUNSETOWNER(fd fd[tun], cmd const[TUNSETOWNER], arg ptr[in, uid]) +ioctl$TUNSETLINK(fd fd[tun], cmd const[TUNSETLINK], arg ptr[in, int32]) +ioctl$TUNSETOFFLOAD(fd fd[tun], cmd const[TUNSETOFFLOAD], arg ptr[in, int32]) +ioctl$TUNSETTXFILTER(fd fd[tun], cmd const[TUNSETTXFILTER], arg ptr[in, tun_filter]) +ioctl$SIOCGIFHWADDR(fd fd[tun], cmd const[SIOCGIFHWADDR], arg ptr[in, ifreq]) +ioctl$SIOCSIFHWADDR(fd fd[tun], cmd const[SIOCSIFHWADDR], arg ptr[in, ifreq]) +ioctl$TUNGETSNDBUF(fd fd[tun], cmd const[TUNGETSNDBUF], arg ptr[out, int32]) +ioctl$TUNSETSNDBUF(fd fd[tun], cmd const[TUNSETSNDBUF], arg ptr[in, int32]) +ioctl$TUNGETVNETHDRSZ(fd fd[tun], cmd const[TUNGETVNETHDRSZ], arg ptr[out, int32]) +ioctl$TUNSETVNETHDRSZ(fd fd[tun], cmd const[TUNSETVNETHDRSZ], arg ptr[in, int32]) +ioctl$TUNATTACHFILTER(fd fd[tun], cmd const[TUNATTACHFILTER], arg ptr[in, sock_fprog]) +ioctl$TUNDETACHFILTER(fd fd[tun], cmd const[TUNDETACHFILTER], arg ptr[in, int32]) +ioctl$TTUNGETFILTER(fd fd[tun], cmd const[TUNGETFILTER], arg ptr[out, int32]) + +tun_buffer [ + pi tun_pi + hdr virtio_net_hdr +] [varlen] + +tun_pi { + flags flags[ifru_flags, int32] + proto int16 + data array[int8] +} + +virtio_net_hdr { + flags flags[virtio_net_flags, int8] + gsotype flags[virtio_net_types, int8] + hdrlen int16 + gsosize int16 + start int16 + offset int16 + data array[int8] +} + +tun_filter { + flags flags[ifru_flags, int32] + count len[addr, int32] + addr ptr[in, array[int8, 6]] +} + +ifreq { + name array[int8, 16] + u ifr_ifru +} + +ifr_ifru [ + addr sockaddr_storage + flags flags[ifru_flags, int16] + mtu int32 + map ifmap + data array[int8, 16] + setting if_settings +] + +ifmap { + start int32 + end int32 + base int16 + irq int8 + dma int8 + port int8 +} + +if_settings { + type int32 + size int32 + u ifs_ifsu +} + +ifs_ifsu [ + hdlc ptr[in, raw_hdlc_proto] + cisco ptr[in, cisco_proto] + fr ptr[in, fr_proto] + pvc ptr[in, fr_proto_pvc] + pvcinfo ptr[in, fr_proto_pvc_info] + sync ptr[in, sync_serial_settings] + tel ptr[in, te1_settings] +] + +raw_hdlc_proto { + encode int16 + parity int16 +} + +cisco_proto{ + val int32 + timeout int32 +} + +fr_proto { + t391 int32 + t392 int32 + n391 int32 + n392 int32 + n393 int32 + lmi int16 + dce int16 +} + +fr_proto_pvc { + dlcl int32 +} + +fr_proto_pvc_info { + dlci int32 + master array[int8, 16] +} + +sync_serial_settings { + rate int32 + type int32 + loop int16 +} + +te1_settings { + rate int32 + type int32 + loop int16 + slot int16 +} + +virtio_net_flags = VIRTIO_NET_HDR_F_NEEDS_CSUM, VIRTIO_NET_HDR_F_DATA_VALID +virtio_net_types = VIRTIO_NET_HDR_GSO_NONE, VIRTIO_NET_HDR_GSO_TCPV4, VIRTIO_NET_HDR_GSO_UDP, VIRTIO_NET_HDR_GSO_TCPV6, VIRTIO_NET_HDR_GSO_ECN +ifru_flags = IFF_TUN, IFF_TAP, IFF_NO_PI, IFF_ONE_QUEUE, IFF_VNET_HDR, IFF_TUN_EXCL, IFF_MULTI_QUEUE, IFF_ATTACH_QUEUE, IFF_DETACH_QUEUE, IFF_PERSIST, IFF_NOFILTER |
