From 44270612b458144e4c3e881bac376d32bb395ee8 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 21 Mar 2019 13:17:23 +0100 Subject: executor: prevent non-null expected warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The added test triggers warnings like these: : In function ‘syz_mount_image.constprop’: :298:3: error: argument 1 null where non-null expected [-Werror=nonnull] In file included from :26:0: /usr/include/x86_64-linux-gnu/sys/stat.h:320:12: note: in a call to function ‘mkdir’ declared here extern int mkdir (const char *__path, __mode_t __mode) ^~~~~ cc1: all warnings being treated as errors : In function ‘syz_open_procfs.constprop’: :530:41: error: ‘%s’ directive argument is null [-Werror=format-truncation=] :85:110: note: in definition of macro ‘NONFAILING’ :532:41: error: ‘%s’ directive argument is null [-Werror=format-truncation=] :85:110: note: in definition of macro ‘NONFAILING’ :534:41: error: ‘%s’ directive argument is null [-Werror=format-truncation=] :85:110: note: in definition of macro ‘NONFAILING’ Use volatile for all arguments of syz_ functions to prevent compiler from treating the arguments as constants in reproducers. Popped up during bisection that used a repro that previously worked. Update #501 --- executor/common_kvm_amd64.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'executor/common_kvm_amd64.h') diff --git a/executor/common_kvm_amd64.h b/executor/common_kvm_amd64.h index 9eb70f71f..db9ab73d4 100644 --- a/executor/common_kvm_amd64.h +++ b/executor/common_kvm_amd64.h @@ -269,7 +269,7 @@ struct kvm_opt { #define KVM_SETUP_VM (1 << 6) // syz_kvm_setup_cpu(fd fd_kvmvm, cpufd fd_kvmcpu, usermem vma[24], text ptr[in, array[kvm_text, 1]], ntext len[text], flags flags[kvm_setup_flags], opts ptr[in, array[kvm_setup_opt, 0:2]], nopt len[opts]) -static uintptr_t syz_kvm_setup_cpu(uintptr_t a0, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7) +static long syz_kvm_setup_cpu(volatile long a0, volatile long a1, volatile long a2, volatile long a3, volatile long a4, volatile long a5, volatile long a6, volatile long a7) { const int vmfd = a0; const int cpufd = a1; -- cgit mrf-deployment