diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-05-05 16:00:01 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-05-05 16:00:01 +0200 |
| commit | 78b251cbd7147f7550d3ac1ac36f7ccaa6c47161 (patch) | |
| tree | be940dd891027812db6aa18ff127d1cf56ea63e0 | |
| parent | 31ea20ce83aa7ca21b4d0ef28d8375a058292a5a (diff) | |
all: fix too long lines
Not sure why I have not seen warnings about
these lines on another machine...
| -rw-r--r-- | sys/syz-extract/fetch.go | 3 | ||||
| -rw-r--r-- | syz-fuzzer/fuzzer.go | 3 | ||||
| -rw-r--r-- | syz-manager/manager.go | 21 | ||||
| -rw-r--r-- | tools/syz-imagegen/imagegen.go | 3 | ||||
| -rw-r--r-- | vm/adb/adb.go | 3 | ||||
| -rw-r--r-- | vm/gce/gce.go | 3 | ||||
| -rw-r--r-- | vm/isolated/isolated.go | 3 | ||||
| -rw-r--r-- | vm/kvm/kvm.go | 3 | ||||
| -rw-r--r-- | vm/odroid/odroid.go | 3 | ||||
| -rw-r--r-- | vm/qemu/qemu.go | 4 | ||||
| -rw-r--r-- | vm/vm.go | 3 | ||||
| -rw-r--r-- | vm/vmimpl/console.go | 9 |
12 files changed, 41 insertions, 20 deletions
diff --git a/sys/syz-extract/fetch.go b/sys/syz-extract/fetch.go index 77410dd55..0a43e4a9e 100644 --- a/sys/syz-extract/fetch.go +++ b/sys/syz-extract/fetch.go @@ -17,7 +17,8 @@ import ( "github.com/google/syzkaller/pkg/osutil" ) -func extract(info *compiler.ConstInfo, cc string, args []string, addSource string, declarePrintf bool) (map[string]uint64, map[string]bool, error) { +func extract(info *compiler.ConstInfo, cc string, args []string, addSource string, declarePrintf bool) ( + map[string]uint64, map[string]bool, error) { data := &CompileData{ AddSource: addSource, Defines: info.Defines, diff --git a/syz-fuzzer/fuzzer.go b/syz-fuzzer/fuzzer.go index 76ccd64e5..c22348d32 100644 --- a/syz-fuzzer/fuzzer.go +++ b/syz-fuzzer/fuzzer.go @@ -381,7 +381,8 @@ func (fuzzer *Fuzzer) pollLoop() { } } -func buildCallList(target *prog.Target, enabledCalls []int, sandbox string) (map[*prog.Syscall]bool, []rpctype.SyscallReason) { +func buildCallList(target *prog.Target, enabledCalls []int, sandbox string) ( + map[*prog.Syscall]bool, []rpctype.SyscallReason) { calls := make(map[*prog.Syscall]bool) for _, n := range enabledCalls { if n >= len(target.Syscalls) { diff --git a/syz-manager/manager.go b/syz-manager/manager.go index c185b4a79..5e01111b7 100644 --- a/syz-manager/manager.go +++ b/syz-manager/manager.go @@ -757,8 +757,10 @@ func (mgr *Manager) saveRepro(res *repro.Result, hub bool) { osutil.WriteFile(filepath.Join(dir, "repro.report"), rep.Report) } osutil.WriteFile(filepath.Join(dir, "repro.stats.log"), res.Stats.Log) - stats := fmt.Sprintf("Extracting prog: %s\nMinimizing prog: %s\nSimplifying prog options: %s\nExtracting C: %s\nSimplifying C: %s\n", - res.Stats.ExtractProgTime, res.Stats.MinimizeProgTime, res.Stats.SimplifyProgTime, res.Stats.ExtractCTime, res.Stats.SimplifyCTime) + stats := fmt.Sprintf("Extracting prog: %s\nMinimizing prog: %s\nSimplifying prog options: %s\n"+ + "Extracting C: %s\nSimplifying C: %s\n", + res.Stats.ExtractProgTime, res.Stats.MinimizeProgTime, res.Stats.SimplifyProgTime, + res.Stats.ExtractCTime, res.Stats.SimplifyCTime) osutil.WriteFile(filepath.Join(dir, "repro.stats"), []byte(stats)) var cprogText []byte if res.CRepro { @@ -928,7 +930,8 @@ func (mgr *Manager) Check(a *rpctype.CheckArgs, r *int) error { log.Fatalf("/sys/kernel/debug/kcov is missing on target machine. Enable CONFIG_KCOV and mount debugfs") } if mgr.cfg.Sandbox == "namespace" && !a.UserNamespaces { - log.Fatalf("/proc/self/ns/user is missing on target machine or permission is denied. Can't use requested namespace sandbox. Enable CONFIG_USER_NS") + log.Fatalf("/proc/self/ns/user is missing on target machine or permission is denied." + + " Can't use requested namespace sandbox. Enable CONFIG_USER_NS") } if mgr.vmPool != nil { if mgr.target.Arch != a.ExecutorArch { @@ -936,13 +939,15 @@ func (mgr *Manager) Check(a *rpctype.CheckArgs, r *int) error { mgr.target.Arch, a.ExecutorArch) } if sys.GitRevision != a.FuzzerGitRev || sys.GitRevision != a.ExecutorGitRev { - log.Fatalf("syz-manager, syz-fuzzer and syz-executor binaries are built on different git revisions\n"+ + log.Fatalf("syz-manager, syz-fuzzer and syz-executor binaries are built"+ + " on different git revisions\n"+ "manager= %v\nfuzzer= %v\nexecutor=%v\n"+ "this is not supported, rebuild all binaries with make", sys.GitRevision, a.FuzzerGitRev, a.ExecutorGitRev) } if mgr.target.Revision != a.FuzzerSyzRev || mgr.target.Revision != a.ExecutorSyzRev { - log.Fatalf("syz-manager, syz-fuzzer and syz-executor binaries have different versions of system call descriptions compiled in\n"+ + log.Fatalf("syz-manager, syz-fuzzer and syz-executor binaries have different"+ + " versions of system call descriptions compiled in\n"+ "manager= %v\nfuzzer= %v\nexecutor=%v\n"+ "this is not supported, rebuild all binaries with make", mgr.target.Revision, a.FuzzerSyzRev, a.ExecutorSyzRev) @@ -1209,8 +1214,10 @@ func (mgr *Manager) hubSync() { mgr.stats["hub new"] += uint64(len(r.Progs) - dropped) mgr.stats["hub sent repros"] += uint64(len(a.Repros)) mgr.stats["hub recv repros"] += uint64(len(r.Repros) - reproDropped) - log.Logf(0, "hub sync: send: add %v, del %v, repros %v; recv: progs: drop %v, new %v, repros: drop: %v, new %v; more %v", - len(a.Add), len(a.Del), len(a.Repros), dropped, len(r.Progs)-dropped, reproDropped, len(r.Repros)-reproDropped, r.More) + log.Logf(0, "hub sync: send: add %v, del %v, repros %v; recv: progs: drop %v, new %v,"+ + " repros: drop: %v, new %v; more %v", + len(a.Add), len(a.Del), len(a.Repros), dropped, len(r.Progs)-dropped, + reproDropped, len(r.Repros)-reproDropped, r.More) if len(r.Progs)+r.More == 0 { break } diff --git a/tools/syz-imagegen/imagegen.go b/tools/syz-imagegen/imagegen.go index ce8216512..2d8cd1770 100644 --- a/tools/syz-imagegen/imagegen.go +++ b/tools/syz-imagegen/imagegen.go @@ -94,7 +94,8 @@ func main() { if syscallSuffix == "ext2" || syscallSuffix == "ext3" { syscallSuffix = "ext4" } - fmt.Printf(`syz_mount_image$%v(&(0x7f0000000000)='%v\x00', &(0x7f0000000100)='./file0\x00', 0x%x, 0x%x, &(0x7f0000000200)=[`, + fmt.Printf(`syz_mount_image$%v(&(0x7f0000000000)='%v\x00', &(0x7f0000000100)='./file0\x00',`+ + ` 0x%x, 0x%x, &(0x7f0000000200)=[`, syscallSuffix, *flagFS, len(data0), len(segs)) addr := 0x7f0000010000 for i, seg := range segs { diff --git a/vm/adb/adb.go b/vm/adb/adb.go index d2fc73c76..21fd5f741 100644 --- a/vm/adb/adb.go +++ b/vm/adb/adb.go @@ -382,7 +382,8 @@ func (inst *instance) Copy(hostSrc string) (string, error) { return vmDst, nil } -func (inst *instance) Run(timeout time.Duration, stop <-chan bool, command string) (<-chan []byte, <-chan error, error) { +func (inst *instance) Run(timeout time.Duration, stop <-chan bool, command string) ( + <-chan []byte, <-chan error, error) { var tty io.ReadCloser var err error if inst.console == "adb" { diff --git a/vm/gce/gce.go b/vm/gce/gce.go index 843072cff..036ffeb8b 100644 --- a/vm/gce/gce.go +++ b/vm/gce/gce.go @@ -198,7 +198,8 @@ func (inst *instance) Copy(hostSrc string) (string, error) { return vmDst, nil } -func (inst *instance) Run(timeout time.Duration, stop <-chan bool, command string) (<-chan []byte, <-chan error, error) { +func (inst *instance) Run(timeout time.Duration, stop <-chan bool, command string) ( + <-chan []byte, <-chan error, error) { conRpipe, conWpipe, err := osutil.LongPipe() if err != nil { return nil, nil, err diff --git a/vm/isolated/isolated.go b/vm/isolated/isolated.go index 8ab3eb9bf..4a6bf7fe6 100644 --- a/vm/isolated/isolated.go +++ b/vm/isolated/isolated.go @@ -261,7 +261,8 @@ func (inst *instance) Copy(hostSrc string) (string, error) { return vmDst, nil } -func (inst *instance) Run(timeout time.Duration, stop <-chan bool, command string) (<-chan []byte, <-chan error, error) { +func (inst *instance) Run(timeout time.Duration, stop <-chan bool, command string) ( + <-chan []byte, <-chan error, error) { args := append(inst.sshArgs("-p"), inst.target) dmesg, err := vmimpl.OpenRemoteConsole("ssh", args...) if err != nil { diff --git a/vm/kvm/kvm.go b/vm/kvm/kvm.go index 597dd5bfe..7911936e3 100644 --- a/vm/kvm/kvm.go +++ b/vm/kvm/kvm.go @@ -225,7 +225,8 @@ func (inst *instance) Copy(hostSrc string) (string, error) { return vmDst, nil } -func (inst *instance) Run(timeout time.Duration, stop <-chan bool, command string) (<-chan []byte, <-chan error, error) { +func (inst *instance) Run(timeout time.Duration, stop <-chan bool, command string) ( + <-chan []byte, <-chan error, error) { outputC := make(chan []byte, 10) errorC := make(chan error, 1) inst.mu.Lock() diff --git a/vm/odroid/odroid.go b/vm/odroid/odroid.go index ca5b5e7b2..0d9ac981e 100644 --- a/vm/odroid/odroid.go +++ b/vm/odroid/odroid.go @@ -319,7 +319,8 @@ func (inst *instance) Copy(hostSrc string) (string, error) { return vmDst, nil } -func (inst *instance) Run(timeout time.Duration, stop <-chan bool, command string) (<-chan []byte, <-chan error, error) { +func (inst *instance) Run(timeout time.Duration, stop <-chan bool, command string) ( + <-chan []byte, <-chan error, error) { tty, err := vmimpl.OpenConsole(inst.cfg.Console) if err != nil { return nil, nil, err diff --git a/vm/qemu/qemu.go b/vm/qemu/qemu.go index f82c88e1f..07066a237 100644 --- a/vm/qemu/qemu.go +++ b/vm/qemu/qemu.go @@ -419,7 +419,8 @@ func (inst *instance) Copy(hostSrc string) (string, error) { return vmDst, nil } -func (inst *instance) Run(timeout time.Duration, stop <-chan bool, command string) (<-chan []byte, <-chan error, error) { +func (inst *instance) Run(timeout time.Duration, stop <-chan bool, command string) ( + <-chan []byte, <-chan error, error) { rpipe, wpipe, err := osutil.LongPipe() if err != nil { return nil, nil, err @@ -489,6 +490,7 @@ func (inst *instance) sshArgs(portArg string) []string { return args } +// nolint: lll const initScript = `#! /bin/bash set -eux mount -t proc none /proc @@ -92,7 +92,8 @@ func (inst *Instance) Forward(port int) (string, error) { return inst.impl.Forward(port) } -func (inst *Instance) Run(timeout time.Duration, stop <-chan bool, command string) (outc <-chan []byte, errc <-chan error, err error) { +func (inst *Instance) Run(timeout time.Duration, stop <-chan bool, command string) ( + outc <-chan []byte, errc <-chan error, err error) { return inst.impl.Run(timeout, stop, command) } diff --git a/vm/vmimpl/console.go b/vm/vmimpl/console.go index 53075820f..07c9b9d27 100644 --- a/vm/vmimpl/console.go +++ b/vm/vmimpl/console.go @@ -27,7 +27,8 @@ func OpenConsole(con string) (rc io.ReadCloser, err error) { } }() var term unix.Termios - if _, _, errno := syscall.Syscall(unix.SYS_IOCTL, uintptr(fd), syscall_TCGETS, uintptr(unsafe.Pointer(&term))); errno != 0 { + _, _, errno := syscall.Syscall(unix.SYS_IOCTL, uintptr(fd), syscall_TCGETS, uintptr(unsafe.Pointer(&term))) + if errno != 0 { return nil, fmt.Errorf("failed to get console termios: %v", errno) } // no parity bit, only need 1 stop bit, no hardware flowcontrol @@ -35,12 +36,14 @@ func OpenConsole(con string) (rc io.ReadCloser, err error) { // ignore modem controls term.Cflag |= unix.B115200 | unix.CS8 | unix.CLOCAL | unix.CREAD // setup for non-canonical mode - term.Iflag &^= unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON + term.Iflag &^= unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | + unix.IGNCR | unix.ICRNL | unix.IXON term.Lflag &^= unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN term.Oflag &^= unix.OPOST term.Cc[unix.VMIN] = 0 term.Cc[unix.VTIME] = 10 // 1 second timeout - if _, _, errno := syscall.Syscall(unix.SYS_IOCTL, uintptr(fd), syscall_TCSETS, uintptr(unsafe.Pointer(&term))); errno != 0 { + _, _, errno = syscall.Syscall(unix.SYS_IOCTL, uintptr(fd), syscall_TCSETS, uintptr(unsafe.Pointer(&term))) + if errno != 0 { return nil, fmt.Errorf("failed to get console termios: %v", errno) } tmp := fd |
