Skip to content
Permalink
Browse files

sys/linux: modernize arch_prctl descriptions

  • Loading branch information...
dvyukov committed Nov 17, 2018
1 parent 1d44216 commit 993f4bbae0f61d6e2a8f8974bd68a005f3a8b895
@@ -60,7 +60,7 @@

#if GOARCH_386
#define GOARCH "386"
#define SYZ_REVISION "a5436331465262bc66482761d656cfabd67917d1"
#define SYZ_REVISION "5be615680ac09c332170d9f080a0be530e160a4f"
#define SYZ_EXECUTOR_USES_FORK_SERVER 1
#define SYZ_EXECUTOR_USES_SHMEM 1
#define SYZ_PAGE_SIZE 4096
@@ -70,7 +70,7 @@

#if GOARCH_amd64
#define GOARCH "amd64"
#define SYZ_REVISION "112acfabe4e7b1b36f0fbc502605c5180d3bee7f"
#define SYZ_REVISION "b7f4b3d01115f65eaf273efa57f7ae10400936dc"
#define SYZ_EXECUTOR_USES_FORK_SERVER 1
#define SYZ_EXECUTOR_USES_SHMEM 1
#define SYZ_PAGE_SIZE 4096
@@ -1313,7 +1313,14 @@ const call_t syscalls[] = {
{"add_key$keyring", 286},
{"add_key$user", 286},
{"alarm", 27},
{"arch_prctl", 384},
{"arch_prctl$ARCH_GET_CPUID", 384},
{"arch_prctl$ARCH_GET_FS", 384},
{"arch_prctl$ARCH_GET_GS", 384},
{"arch_prctl$ARCH_MAP_VDSO_32", 384},
{"arch_prctl$ARCH_MAP_VDSO_64", 384},
{"arch_prctl$ARCH_MAP_VDSO_X32", 384},
{"arch_prctl$ARCH_SET_CPUID", 384},
{"arch_prctl$ARCH_SET_GS", 384},
{"bind", 361},
{"bind$alg", 361},
{"bind$ax25", 361},
@@ -3629,7 +3636,14 @@ const call_t syscalls[] = {
{"add_key$keyring", 248},
{"add_key$user", 248},
{"alarm", 37},
{"arch_prctl", 158},
{"arch_prctl$ARCH_GET_CPUID", 158},
{"arch_prctl$ARCH_GET_FS", 158},
{"arch_prctl$ARCH_GET_GS", 158},
{"arch_prctl$ARCH_MAP_VDSO_32", 158},
{"arch_prctl$ARCH_MAP_VDSO_64", 158},
{"arch_prctl$ARCH_MAP_VDSO_X32", 158},
{"arch_prctl$ARCH_SET_CPUID", 158},
{"arch_prctl$ARCH_SET_GS", 158},
{"bind", 49},
{"bind$alg", 49},
{"bind$ax25", 49},
{NR: 27, Name: "alarm", CallName: "alarm", Args: []Type{
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "seconds", TypeSize: 4}}},
}},
{NR: 384, Name: "arch_prctl", CallName: "arch_prctl", Args: []Type{
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "arch_prctl_code", FldName: "code", TypeSize: 4}}, Vals: []uint64{4099, 4097, 4100}},
&PtrType{TypeCommon: TypeCommon{TypeName: "buffer", FldName: "addr", TypeSize: 4}, Type: &BufferType{TypeCommon: TypeCommon{IsVarlen: true}}},
{NR: 384, Name: "arch_prctl$ARCH_GET_CPUID", CallName: "arch_prctl", Args: []Type{
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "code", TypeSize: 4}}, Val: 4113},
}},
{NR: 384, Name: "arch_prctl$ARCH_GET_FS", CallName: "arch_prctl", Args: []Type{
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "code", TypeSize: 4}}, Val: 4099},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "arg", TypeSize: 4}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8, ArgDir: 1}}}},
}},
{NR: 384, Name: "arch_prctl$ARCH_GET_GS", CallName: "arch_prctl", Args: []Type{
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "code", TypeSize: 4}}, Val: 4100},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "arg", TypeSize: 4}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8, ArgDir: 1}}}},
}},
{NR: 384, Name: "arch_prctl$ARCH_MAP_VDSO_32", CallName: "arch_prctl", Args: []Type{
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "code", TypeSize: 4}}, Val: 8194},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "arg", TypeSize: 4}}},
}},
{NR: 384, Name: "arch_prctl$ARCH_MAP_VDSO_64", CallName: "arch_prctl", Args: []Type{
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "code", TypeSize: 4}}, Val: 8195},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "arg", TypeSize: 4}}},
}},
{NR: 384, Name: "arch_prctl$ARCH_MAP_VDSO_X32", CallName: "arch_prctl", Args: []Type{
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "code", TypeSize: 4}}, Val: 8193},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "arg", TypeSize: 4}}},
}},
{NR: 384, Name: "arch_prctl$ARCH_SET_CPUID", CallName: "arch_prctl", Args: []Type{
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "code", TypeSize: 4}}, Val: 4114},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "arg", TypeSize: 4}}, Kind: 2, RangeEnd: 1},
}},
{NR: 384, Name: "arch_prctl$ARCH_SET_GS", CallName: "arch_prctl", Args: []Type{
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "code", TypeSize: 4}}, Val: 4097},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "arg", TypeSize: 8}}},
}},
{NR: 361, Name: "bind", CallName: "bind", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "sock", FldName: "fd", TypeSize: 4}},
{Name: "ALG_SET_IV", Value: 2},
{Name: "ALG_SET_KEY", Value: 1},
{Name: "ALG_SET_OP", Value: 3},
{Name: "ARCH_GET_CPUID", Value: 4113},
{Name: "ARCH_GET_FS", Value: 4099},
{Name: "ARCH_GET_GS", Value: 4100},
{Name: "ARCH_MAP_VDSO_32", Value: 8194},
{Name: "ARCH_MAP_VDSO_64", Value: 8195},
{Name: "ARCH_MAP_VDSO_X32", Value: 8193},
{Name: "ARCH_SET_CPUID", Value: 4114},
{Name: "ARCH_SET_FS", Value: 4098},
{Name: "ARCH_SET_GS", Value: 4097},
{Name: "ARPHRD_6LOWPAN", Value: 825},
{Name: "bpf_insn_load_imm_dw", Value: 24},
}

const revision_386 = "a5436331465262bc66482761d656cfabd67917d1"
const revision_386 = "5be615680ac09c332170d9f080a0be530e160a4f"
{NR: 37, Name: "alarm", CallName: "alarm", Args: []Type{
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "seconds", TypeSize: 8}}},
}},
{NR: 158, Name: "arch_prctl", CallName: "arch_prctl", Args: []Type{
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "arch_prctl_code", FldName: "code", TypeSize: 8}}, Vals: []uint64{4099, 4097, 4100}},
&PtrType{TypeCommon: TypeCommon{TypeName: "buffer", FldName: "addr", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{IsVarlen: true}}},
{NR: 158, Name: "arch_prctl$ARCH_GET_CPUID", CallName: "arch_prctl", Args: []Type{
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "code", TypeSize: 8}}, Val: 4113},
}},
{NR: 158, Name: "arch_prctl$ARCH_GET_FS", CallName: "arch_prctl", Args: []Type{
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "code", TypeSize: 8}}, Val: 4099},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "arg", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8, ArgDir: 1}}}},
}},
{NR: 158, Name: "arch_prctl$ARCH_GET_GS", CallName: "arch_prctl", Args: []Type{
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "code", TypeSize: 8}}, Val: 4100},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "arg", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8, ArgDir: 1}}}},
}},
{NR: 158, Name: "arch_prctl$ARCH_MAP_VDSO_32", CallName: "arch_prctl", Args: []Type{
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "code", TypeSize: 8}}, Val: 8194},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "arg", TypeSize: 8}}},
}},
{NR: 158, Name: "arch_prctl$ARCH_MAP_VDSO_64", CallName: "arch_prctl", Args: []Type{
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "code", TypeSize: 8}}, Val: 8195},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "arg", TypeSize: 8}}},
}},
{NR: 158, Name: "arch_prctl$ARCH_MAP_VDSO_X32", CallName: "arch_prctl", Args: []Type{
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "code", TypeSize: 8}}, Val: 8193},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "arg", TypeSize: 8}}},
}},
{NR: 158, Name: "arch_prctl$ARCH_SET_CPUID", CallName: "arch_prctl", Args: []Type{
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "code", TypeSize: 8}}, Val: 4114},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "arg", TypeSize: 8}}, Kind: 2, RangeEnd: 1},
}},
{NR: 158, Name: "arch_prctl$ARCH_SET_GS", CallName: "arch_prctl", Args: []Type{
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "code", TypeSize: 8}}, Val: 4097},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "arg", TypeSize: 8}}},
}},
{NR: 49, Name: "bind", CallName: "bind", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "sock", FldName: "fd", TypeSize: 4}},
{Name: "ALG_SET_IV", Value: 2},
{Name: "ALG_SET_KEY", Value: 1},
{Name: "ALG_SET_OP", Value: 3},
{Name: "ARCH_GET_CPUID", Value: 4113},
{Name: "ARCH_GET_FS", Value: 4099},
{Name: "ARCH_GET_GS", Value: 4100},
{Name: "ARCH_MAP_VDSO_32", Value: 8194},
{Name: "ARCH_MAP_VDSO_64", Value: 8195},
{Name: "ARCH_MAP_VDSO_X32", Value: 8193},
{Name: "ARCH_SET_CPUID", Value: 4114},
{Name: "ARCH_SET_FS", Value: 4098},
{Name: "ARCH_SET_GS", Value: 4097},
{Name: "ARPHRD_6LOWPAN", Value: 825},
{Name: "bpf_insn_load_imm_dw", Value: 24},
}

const revision_amd64 = "112acfabe4e7b1b36f0fbc502605c5180d3bee7f"
const revision_amd64 = "b7f4b3d01115f65eaf273efa57f7ae10400936dc"
@@ -113,7 +113,13 @@ prctl$PR_SET_SPECULATION_CTRL(option const[PR_SET_SPECULATION_CTRL], arg2 const[

pr_spec_mode = PR_SPEC_ENABLE, PR_SPEC_DISABLE, PR_SPEC_FORCE_DISABLE

arch_prctl(code flags[arch_prctl_code], addr buffer[in])
arch_prctl$ARCH_GET_FS(code const[ARCH_GET_FS], arg ptr[out, int64])
arch_prctl$ARCH_GET_GS(code const[ARCH_GET_GS], arg ptr[out, int64])
arch_prctl$ARCH_SET_GS(code const[ARCH_SET_GS], arg int64)
arch_prctl$ARCH_GET_CPUID(code const[ARCH_GET_CPUID])
arch_prctl$ARCH_SET_CPUID(code const[ARCH_SET_CPUID], arg boolptr)
arch_prctl$ARCH_MAP_VDSO_X32(code const[ARCH_MAP_VDSO_X32], arg intptr)
arch_prctl$ARCH_MAP_VDSO_32(code const[ARCH_MAP_VDSO_32], arg intptr)
arch_prctl$ARCH_MAP_VDSO_64(code const[ARCH_MAP_VDSO_64], arg intptr)

arch_prctl_code = ARCH_GET_FS, ARCH_SET_GS, ARCH_GET_GS
_ = ARCH_SET_FS
@@ -1,6 +1,11 @@
# AUTOGENERATED FILE
ARCH_GET_CPUID = 4113
ARCH_GET_FS = 4099
ARCH_GET_GS = 4100
ARCH_MAP_VDSO_32 = 8194
ARCH_MAP_VDSO_64 = 8195
ARCH_MAP_VDSO_X32 = 8193
ARCH_SET_CPUID = 4114
ARCH_SET_FS = 4098
ARCH_SET_GS = 4097
CAP_LAST_CAP = 37
@@ -1,6 +1,11 @@
# AUTOGENERATED FILE
ARCH_GET_CPUID = 4113
ARCH_GET_FS = 4099
ARCH_GET_GS = 4100
ARCH_MAP_VDSO_32 = 8194
ARCH_MAP_VDSO_64 = 8195
ARCH_MAP_VDSO_X32 = 8193
ARCH_SET_CPUID = 4114
ARCH_SET_FS = 4098
ARCH_SET_GS = 4097
CAP_LAST_CAP = 37
@@ -1,6 +1,11 @@
# AUTOGENERATED FILE
# ARCH_GET_CPUID is not set
# ARCH_GET_FS is not set
# ARCH_GET_GS is not set
# ARCH_MAP_VDSO_32 is not set
# ARCH_MAP_VDSO_64 is not set
# ARCH_MAP_VDSO_X32 is not set
# ARCH_SET_CPUID is not set
# ARCH_SET_FS is not set
# ARCH_SET_GS is not set
CAP_LAST_CAP = 37
@@ -1,6 +1,11 @@
# AUTOGENERATED FILE
# ARCH_GET_CPUID is not set
# ARCH_GET_FS is not set
# ARCH_GET_GS is not set
# ARCH_MAP_VDSO_32 is not set
# ARCH_MAP_VDSO_64 is not set
# ARCH_MAP_VDSO_X32 is not set
# ARCH_SET_CPUID is not set
# ARCH_SET_FS is not set
# ARCH_SET_GS is not set
CAP_LAST_CAP = 37
@@ -1,6 +1,11 @@
# AUTOGENERATED FILE
# ARCH_GET_CPUID is not set
# ARCH_GET_FS is not set
# ARCH_GET_GS is not set
# ARCH_MAP_VDSO_32 is not set
# ARCH_MAP_VDSO_64 is not set
# ARCH_MAP_VDSO_X32 is not set
# ARCH_SET_CPUID is not set
# ARCH_SET_FS is not set
# ARCH_SET_GS is not set
CAP_LAST_CAP = 37

2 comments on commit 993f4bb

@blackgnezdo

This comment has been minimized.

Copy link
Member

replied Nov 18, 2018

@dvyukov @mptre
OpenBSD is broken by this change, the broken test which happens to be a part of gmake test is this one:

env CGO_ENABLED=1 go test -short ./sys/linux/init_test.go 

This unfortunately means we can't deploy OpenBSD syz-bot until we fix the problem.

% git bisect good
git bisect good
993f4bbae0f61d6e2a8f8974bd68a005f3a8b895 is the first bad commit
commit 993f4bbae0f61d6e2a8f8974bd68a005f3a8b895
Author: Dmitry Vyukov <dvyukov@google.com>
Date:   Sat Nov 17 14:33:41 2018 -0800

    sys/linux: modernize arch_prctl descriptions

:040000 040000 2bad256d50f3417741d93ecc83459225d1712c03 e2febe0762a5856853110ca37084ab1b4364e20b M	executor
:040000 040000 061f10e591f6043cbb234ada0ecaaa83d3d898f2 850a32479ffcef36fe88e1546c2154c0c3b41b7f M	sys
@dvyukov

This comment has been minimized.

Copy link
Collaborator Author

replied Nov 20, 2018

My fault. Now fixed by:
99721ce

Please sign in to comment.
You can’t perform that action at this time.