On Sun, Jan 22, 2017 at 4:01 AM, Jeremy Huang <
jere...@gmail.com> wrote:
> Hi Dmitry,
> I followed you mentioned above and changed my config as following :
> {
> "http": "localhost:5000",
> "workdir": "/home/w4118/syzkaller/workdir",
> "kernel": "/home/w4118/utils/goldfish/arch/x86/boot/bzImage",
> "syzkaller": "/home/w4118/syzkaller",
> "type": "qemu",
> "vmlinux": "-",
> "Image": "9p",
> "initrd":
> "/home/w4118/utils/android-sdk-linux/system-images/android-24/default/x86_64/ramdisk.img",
> "Sshkey": "/home/w4118/syzkaller/tools/ssh/id_rsa",
> "procs": 8,
> "count": 4,
> "cpu": 2,
> "mem": 2048,
> "cover": false,
> "sandbox": "none"
> }
>
> It will appear the root fs error before I added the "initrd" to my config.
> I though that it may have been caused by `root=/dev/root`.
>
https://github.com/google/syzkaller/blob/master/vm/qemu/qemu.go#L199
> However, I add the initrd portin to ramdisk.img in my config.
> it showed `binder: 1200:1200 transaction failed 29189, size 0-0'.
> What should I set syzkaller on the goldfish-android-kernel-3.18 ?
Binder is something android-specific, right?
I don't know about android. It is a strange system.
We've opened some docs on using android/arm64 with qemu, maybe you
will find something useful there:
https://github.com/google/syzkaller/wiki/Fuzzing-ARM64-kernels-with-Syzkaller-on-QEMU
> I recall that used to initrd file instead of `root=/dev/sda' on SUSE os.
> Then it does work.
>
> Jeremy
>
> 2017-01-19 17:34 GMT+08:00 Dmitry Vyukov <
dvy...@google.com>:
>>
>> On Thu, Jan 19, 2017 at 10:12 AM, Jeremy Huang <
jere...@gmail.com>
>> wrote:
>> > Wow! Many Thanks.
>> > Should I modify the `ssh' part of qemu.go instead of `adb' part of
>> > adb.go ?
>>
>> Depending on what image you will choose.
>> If you use a debian userspace, then it does support ssh. So everything
>> should work out-of-the-box. I use this script to build a debian
>> userspace and it does work with x86 android kernel:
>>
https://github.com/google/syzkaller/blob/master/tools/create-image.sh
>> Also "9p" option should work with ssh.
>>
>>
>> > I remembered that android kernel doesn't supported ssh defaultly.
>> > What does the 9p mean?
>>
>> 9p option shares part of your _host_ image as guest image (in
>> read-only mode, of course, so your host won't be corrupted as the
>> result of fuzzing). I.e. your host /bin becomes guest's /bin, etc. But
>> it creates private /etc with a simple config for sshd. You can see the
>> init script here:
>>
https://github.com/google/syzkaller/blob/master/vm/qemu/qemu.go#L384
>> (search for 9p in that file for other details).
>>
>>
>>
>> > Jeremy Huang
>> >
>> > 2017-01-19 16:54 GMT+08:00 Dmitry Vyukov <
dvy...@google.com>:
>> >>
>> >> On Thu, Jan 19, 2017 at 9:35 AM, Jeremy Huang <
jere...@gmail.com>
>> >> wrote:
>> >> >
>> >> >
>> >> > 2017-01-19 15:29 GMT+08:00 Dmitry Vyukov <
dvy...@google.com>:
>> >> >>
>> >> >> On Thu, Jan 19, 2017 at 7:58 AM, Jeremy Huang <
jere...@gmail.com>
>> >> >> wrote:
>> >> >> > Hi Dmitry,
>> >> >> >
>> >> >> > I'd like to fuzz android kernel via emulator on syzkaller.
>> >> >> > So far, the syzkaller only supported arm development board.
>> >> >> > So, I tried to modify minimally the vm/adb.go, just like the
>> >> >> > vm/qemu.go.
>> >> >> > But I still can't get the console ? just saw the program 0 and
>> >> >> > crashes
>> >> >> > 0...
>> >> >> > Could you refer the attachment to help me :)
>> >> >>
>> >> >> Hi Jeremy,
>> >> >>
>> >> >> What exactly is "emulator"?
>> >> >
>> >> > it's android emulator :
>> >> >
https://android.googlesource.com/platform/prebuilts/android-emulator
>> >> >
>> >> >> Can you make it work without syzkaller?
>> >> >
>> >> > Yes, I can. just command :
>> >> > `emulator @x86 -kernel arch/x86/boot/bzImage -show-kernel
>> >> > -no-window
>> >> > -qemu --enable-kvm`
>> >> > the kernel is android kernel 3.18 version.
>> >> >
>> >> >> Do you get console output without syzkaller?
>> >> >
>> >> > Yes, I can get it.
>> >> >>
>> >> >> What is the sequence of commands to start it, ssh into it, read
>> >> >> console
>> >> >> output?
>> >> >
>> >> > Firstly, I patched adb.go and executed the command :
>> >> > `emulator @x86 -kernel arch/x86/boot/bzImage -show-kernel
>> >> > -no-window
>> >> > -qemu --enable-kvm`
>> >> > Then, launched syzkaller.
>> >> >
>> >> >>
>> >> >> We simply used qemu in emulation mode to test arm64 android kernel
>> >> >> on
>> >> >> x86 host. It worked out of the box with "qemu" type.
>> >> >> We also run x86_64 android kernel with debian userspace in qemu-kvm
>> >> >> on
>> >> >> x86
>> >> >> host.
>> >> >
>> >> >
>> >> > Great. it sounds that I just want to do.
>> >> > The following config file that I used.
>> >> > {
>> >> > "http": "localhost:5000",
>> >> > "workdir": "/home/w4118/syzkaller/workdir",
>> >> > "vmlinux": "-",
>> >> > "syzkaller": "/home/w4118/syzkaller",
>> >> > "type": "adb",
>> >> > "procs": 1,
>> >> > "cover": false,
>> >> > "sandbox": "none",
>> >> > "devices": ["emulator-5554"]
>> >> > }
>> >> > So, I need to change the type to "qemu" from "adb" ?
>> >> > And somethings else I need to do?
>> >>
>> >>
>> >> Yes, it should be simpler with qemu.
>> >> You also need "kernel" parameter to point to the bzImage file. And
>> >> "image" parameter to point to the image file. It seems that the
>> >> emulator has some prebuilt image file, if you figure out how the
>> >> emulator starts qemu (the command line), then you can extract the
>> >> image file from the command line (it should be in -hda argument).
>> >> Alternatively you can try to specify "9p" in image parameter, then
>> >> syzkaller will build a simple 9p-based image based on your host
>> >> system.
>> >> Initially run syz-manager with -debug flag, then it will print
>> >> commands it is executing and also qemu output.
>> >
>> >
>
>