aboutsummaryrefslogtreecommitdiffstats
path: root/sys/syz-extract
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2019-01-25 16:10:00 +0100
committerDmitry Vyukov <dvyukov@google.com>2019-01-25 16:10:00 +0100
commita3d9f7e34dbad7e7c6804ee5107c3ddcf0bfef22 (patch)
tree5520a26ab51407bc35d900a8ef77dd61158cfd76 /sys/syz-extract
parent6fde58c61bdd29262e5e1af69b65d3d3d4edf644 (diff)
sys/linux: fix up mptcp descriptions
1. Generate .const files for all arches. 2. Don't extract mptcp consts on android. 3. Remove mptcp includes from vnet.txt. 4. Enable CONFIG_MPTCP in syz-extract (mptcp is not like all other kernel headers).
Diffstat (limited to 'sys/syz-extract')
-rw-r--r--sys/syz-extract/extract.go9
-rw-r--r--sys/syz-extract/linux.go10
2 files changed, 14 insertions, 5 deletions
diff --git a/sys/syz-extract/extract.go b/sys/syz-extract/extract.go
index fe32bc429..29ef66196 100644
--- a/sys/syz-extract/extract.go
+++ b/sys/syz-extract/extract.go
@@ -21,7 +21,7 @@ import (
)
var (
- flagOS = flag.String("os", "", "target OS")
+ flagOS = flag.String("os", runtime.GOOS, "target OS")
flagBuild = flag.Bool("build", false, "regenerate arch-specific kernel headers")
flagSourceDir = flag.String("sourcedir", "", "path to kernel source checkout dir")
flagIncludes = flag.String("includedirs", "", "path to other kernel source include dirs separated by commas")
@@ -245,16 +245,19 @@ func archFileList(os, arch string, files []string) (string, []string, []string,
if err != nil || len(matches) == 0 {
return "", nil, nil, fmt.Errorf("failed to find sys files: %v", err)
}
+ manualFiles := map[string]bool{
+ // Not upstream, generated on https://github.com/multipath-tcp/mptcp_net-next
+ "mptcp.txt": true,
+ }
androidFiles := map[string]bool{
"tlk_device.txt": true,
// This was generated on:
// https://source.codeaurora.org/quic/la/kernel/msm-4.9 msm-4.9
"video4linux.txt": true,
- "mptcp.txt": true,
}
for _, f := range matches {
f = filepath.Base(f)
- if os == "linux" && android != androidFiles[f] {
+ if manualFiles[f] || os == "linux" && android != androidFiles[f] {
continue
}
files = append(files, f)
diff --git a/sys/syz-extract/linux.go b/sys/syz-extract/linux.go
index 6cfc18419..45f8144ce 100644
--- a/sys/syz-extract/linux.go
+++ b/sys/syz-extract/linux.go
@@ -83,10 +83,16 @@ func (*linux) prepareArch(arch *Arch) error {
return fmt.Errorf("make defconfig failed: %v\n%s", err, out)
}
// Without CONFIG_NETFILTER kernel does not build.
- out, err = osutil.RunCmd(time.Minute, buildDir, "sed", "-i",
+ _, err = osutil.RunCmd(time.Minute, buildDir, "sed", "-i",
"s@# CONFIG_NETFILTER is not set@CONFIG_NETFILTER=y@g", ".config")
if err != nil {
- return fmt.Errorf("sed .config failed: %v\n%s", err, out)
+ return fmt.Errorf("sed .config failed: %v", err)
+ }
+ // include/net/mptcp.h is the only header in kernel that guards some of the consts with own config
+ _, err = osutil.RunCmd(time.Minute, buildDir, "sed", "-i",
+ "s@# CONFIG_MPTCP is not set@CONFIG_MPTCP=y@g", ".config")
+ if err != nil {
+ return fmt.Errorf("sed .config failed: %v", err)
}
out, err = osutil.RunCmd(time.Hour, kernelDir, "make", append(makeArgs, "olddefconfig")...)
if err != nil {