diff options
| author | Florent Revest <revest@chromium.org> | 2024-11-28 01:50:23 +0100 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2024-12-09 18:35:48 +0000 |
| commit | deb728774249ce479316c219f77530e2af52e3bd (patch) | |
| tree | 0c40542088d8ffebf4ee5ddb56a61a94ed57afaf /syz-manager | |
| parent | 07e46fbc2bd7ff8782c975596672e4e3d3891865 (diff) | |
prog: annotate image assets with fsck logs
Syscall attributes are extended with a fsck command field which lets
file system mount definitions specify a fsck-like command to run. This
is required because all file systems have a custom fsck command
invokation style.
When uploading a compressed image asset to the dashboard, syz-manager
also runs the fsck command and logs its output over the dashapi.
The dashboard logs these fsck logs into the database.
This has been requested by fs maintainer Ted Tso who would like to
quickly understand whether a filesystem is corrupted or not before
looking at a reproducer in more details. Ultimately, this could be used
as an early triage sign to determine whether a bug is obviously
critical.
Diffstat (limited to 'syz-manager')
| -rw-r--r-- | syz-manager/manager.go | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/syz-manager/manager.go b/syz-manager/manager.go index 3b6072629..98c7b4dbd 100644 --- a/syz-manager/manager.go +++ b/syz-manager/manager.go @@ -31,6 +31,7 @@ import ( "github.com/google/syzkaller/pkg/fuzzer/queue" "github.com/google/syzkaller/pkg/gce" "github.com/google/syzkaller/pkg/ifaceprobe" + "github.com/google/syzkaller/pkg/image" "github.com/google/syzkaller/pkg/log" "github.com/google/syzkaller/pkg/manager" "github.com/google/syzkaller/pkg/mgrconfig" @@ -921,7 +922,7 @@ func (mgr *Manager) uploadReproAssets(repro *repro.Result) []dashapi.NewAsset { } ret := []dashapi.NewAsset{} - repro.Prog.ForEachAsset(func(name string, typ prog.AssetType, r io.Reader) { + repro.Prog.ForEachAsset(func(name string, typ prog.AssetType, r io.Reader, c *prog.Call) { dashTyp, ok := map[prog.AssetType]dashapi.AssetType{ prog.MountInRepro: dashapi.MountInRepro, }[typ] @@ -933,6 +934,16 @@ func (mgr *Manager) uploadReproAssets(repro *repro.Result) []dashapi.NewAsset { log.Logf(1, "processing of the asset %v (%v) failed: %v", name, typ, err) return } + // Report file systems that fail fsck with a separate tag. + if mgr.cfg.RunFsck && dashTyp == dashapi.MountInRepro && c.Meta.Attrs.Fsck != "" { + logs, isClean, err := image.Fsck(r, c.Meta.Attrs.Fsck) + if err != nil { + log.Logf(1, "fsck of the asset %v failed: %v", name, err) + } else { + asset.FsckLog = logs + asset.FsIsClean = isClean + } + } ret = append(ret, asset) }) return ret |
