aboutsummaryrefslogtreecommitdiffstats
path: root/prog/prog_test.go
diff options
context:
space:
mode:
authorFlorent Revest <revest@chromium.org>2024-11-28 01:50:23 +0100
committerAleksandr Nogikh <nogikh@google.com>2024-12-09 18:35:48 +0000
commitdeb728774249ce479316c219f77530e2af52e3bd (patch)
tree0c40542088d8ffebf4ee5ddb56a61a94ed57afaf /prog/prog_test.go
parent07e46fbc2bd7ff8782c975596672e4e3d3891865 (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 'prog/prog_test.go')
-rw-r--r--prog/prog_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/prog/prog_test.go b/prog/prog_test.go
index 29f2aee5b..96280b3e8 100644
--- a/prog/prog_test.go
+++ b/prog/prog_test.go
@@ -140,6 +140,22 @@ func TestVmaType(t *testing.T) {
}
}
+func TestFsckAttr(t *testing.T) {
+ target, err := GetTarget("test", "64")
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ syscall := target.SyscallMap["test$fsck_attr"]
+ if syscall == nil {
+ t.Fatal("could not find test$fsck_attr in sys/test")
+ }
+
+ if syscall.Attrs.Fsck != "fsck.test -n" {
+ t.Fatalf("unexpected fsck command %s", syscall.Attrs.Fsck)
+ }
+}
+
// TestCrossTarget ensures that a program serialized for one arch can be
// deserialized for another arch. This happens when managers exchange
// programs via hub.