Closed williamcroberts closed 1 year ago
Also I am using my last known good KConfig from here:
In order to see detailed logs from the guest you need the ensure following (will file an issue to update the docs, it is not mentioned there):
1) change qemu_append line to select the one with more debug (it is commented out by default) in bkc/kafl/kafl_config.yaml
2) modify kafl.yaml in your local "data/test1/harness_name" to comment out "#log_crashes: True" and add "log_hprintf: True" .
3) run with "fuzz.sh run build -p 2 --log-hprintf"
The you will better boot log from the guest.
Filed issue to update the docs on verbose input: https://github.com/intel/ccc-linux-guest-hardening/issues/105
Yep, that got me better logs, why wouldn't we just make that the default?
I tried applying the patch below, but still getting tsc: Unable to calibrate against PIT
diff --git a/arch/x86/kernel/kafl-agent.c b/arch/x86/kernel/kafl-agent.c
index 79a97655a2e1..0639f1acf1ac 100644
--- a/arch/x86/kernel/kafl-agent.c
+++ b/arch/x86/kernel/kafl-agent.c
@@ -403,6 +403,8 @@ static bool kafl_fuzz_filter(uintptr_t addr, enum tdx_fuzz_loc type)
case 0xc000 ... 0xcfff:
return 0;
#endif
+ case 0x70 ... 0x71:
+ return 0;
default:
return 1;
}
"tsc: Unable to calibrate against PIT", yes, this message seems to be ok actually (I forgot that our emulation VM is not a real TD and in such TD this can happen) actually I saw that output in a good campaign also, so smth else is wrong. How do I reproduce your setup?
why wouldn't we just make that the default? I guess because it is not good default if you actually want to fuzz (which ideally what people would like to do), not to debug why it is not fuzzing...
"tsc: Unable to calibrate against PIT", yes, this message seems to be ok actually (I forgot that our emulation VM is not a real TD and in such TD this can happen) actually I saw that output in a good campaign also, so smth else is wrong. How do I reproduce your setup?
why wouldn't we just make that the default? I guess because it is not good default if you actually want to fuzz (which ideally what people would like to do), not to debug why it is not fuzzing...
All I am doing is following the setup:
make env
from cc-linux-guest-hardening repoiniit_harness.py ~/data/test1 BPH_P9_VIRTIO_PROBE
cd ~/data/test1/BPH_P9_VIRTIO_PROBE
fuzz.sh build ./build
cd build
cp
the KConfig from my last known good one over (https://github.com/intel/ccc-linux-guest-hardening/files/10946069/config.bak.txt): cp ~/config.bak .config
make -j4
to rebuild the kernelcd ..
back to parent directory BPH_P9_VIRTIO_PROBE.fuzz.sh run build -p 2 --debug --log-hprintf
@williamcroberts when you overwrite the config in the above step 7, you are enabling only CONFIG_TDX_FUZZ_HARNESS_POST_TRAP harness from the guest point of view, so virtio inputs are not being injected.
Could you please try the following default sequence instead:
@williamcroberts when you overwrite the config in the above step 7, you are enabling only CONFIG_TDX_FUZZ_HARNESS_POST_TRAP harness from the guest point of view, so virtio inputs are not being injected.
Oh duh :-p
Could you please try the following default sequence instead:
- Make changes to linux-guest under the ccc-linux-guest-hardening
- make env from cc-linux-guest-hardening repo
- iniit_harness.py ~/data/test1 BPH_P9_VIRTIO_PROBE
- cd ~/data/test1/BPH_P9_VIRTIO_PROBE
- fuzz.sh build ./build
- run the campaign fuzz.sh run build -p 2 --debug --log-hprintf
Thanks @ereshetova that was obvious and a duh moment, I appreciate you pointing that out. That patches seem to work. I'll do some cleanups and submit another PR.
@williamcroberts Great! Thank you! Is it ok to close this issue?
I can't see any good logging in any of the campaigns that include VIRTIO:
When I run
fuzz.sh
, the output to the console is:See the full logs: kafl.log
I have some local changes with a bunch of printk's to see what's going on, and I don't even see my printk from the kernel's entry point at the KAFL ifdef.
But their in the vmlinux is both build and shm location: