编译 Android kernel 并在QEMU中运行

为 syzkaller fuzz Android kernel 作准备(一)

请注意,本文编写于 133 天前,最后修改于 133 天前,其中某些信息可能已经过时。

文章参考: Build Android Kernel and Run on QEMU with Minimal Environment: Step by Step

1.下载源码

在 AOSP kernel 中有个分支叫做 Goldfish,该分支是为模拟器准备的,所以下载该分支代码。

git clone https://android.googlesource.com/kernel/goldfish kernel/goldfish

2.进入源码文件夹

master分支是没东西的,所以文件夹为空(开发者应该是直接向对应分支提交代码

cd ./kernel/goldfish

3.列出分支,checkout最新的一个

git branch -a

* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/android-3.18
  remotes/origin/android-4.14
  remotes/origin/android-goldfish-2.6.29
  remotes/origin/android-goldfish-3.10
  remotes/origin/android-goldfish-3.10-k-dev
  remotes/origin/android-goldfish-3.10-l-mr1-dev
  remotes/origin/android-goldfish-3.10-m-dev
  remotes/origin/android-goldfish-3.10-n-dev
  remotes/origin/android-goldfish-3.18
  remotes/origin/android-goldfish-3.18-dev
  remotes/origin/android-goldfish-3.4
  remotes/origin/android-goldfish-3.4-l-mr1-dev
  remotes/origin/android-goldfish-4.14-dev
  remotes/origin/android-goldfish-4.14-dev.120914098
  remotes/origin/android-goldfish-4.14-dev.143174688
  remotes/origin/android-goldfish-4.14-dev.20190417 # <-----    
  remotes/origin/android-goldfish-4.14-dev.backup
  remotes/origin/android-goldfish-4.4-dev
  remotes/origin/android-goldfish-4.9-dev 
  remotes/origin/b120914098
  remotes/origin/heads/for/android-goldfish-3.18-dev
  remotes/origin/linux-goldfish-3.0-wip
  remotes/origin/master

AOSP 通用内核是长期支持 (LTS) 内核的下游,包含与 Android 社区相关但尚未合并到 LTS 的补丁程序

目前最新的 LTS linux kernel 版本是 4.19,所以选4.14

4.checkout 选中分支

git checkout -b android-4.14-dev.2019 origin/android-goldfish-4.14-dev.20190417

5.编译

make defconfig
make -j7

Result is here: arch/x86/boot/bzImage.

6.安装QEMU

sudo apt install qemu

or just

sudo apt install qemu-system-x86

7. 使用ext4镜像运行Android Linux kernel

下载 1GB 的 wheezy.img.

Wheezy 镜像是一个 有646M 剩余空间 Debian 7 的 R/W 镜像,是syzkaller提供的,供 syzbot 使用,与复现崩溃有关 1

wget https://storage.googleapis.com/syzkaller/wheezy.img

以下命令在参考文章中存在错误-m 1GB -> -m 1G

qemu-system-x86_64 -m 1G -kernel arch/x86/boot/bzImage -hda wheezy.img -append "root=/dev/sda"

Login: root. Password: empty.

添加新评论

请不要水评论

已有 55 条评论

can you buy toradol over the counter sildenafil gel 100 mg prozac fluoxetine buy ampicillin anafranil 10 buy synthroid online without prescription amoxicillin 875 125 mg seroquel medication buy kamagra benicar hctz tadalafil 5mg cost in canada lasix water pills baclofen pill pharmacy prescription levitra tadalafil daily india where to buy prednisone online without a script how to get accutane in canada robaxin 500 mg tablet generic propecia cost cymbalta duloxetine hcl

amoxicillin 875 mg tablet

where to buy sildenafil online with paypal

prozac 40 g female viagra pill buy online tadalafil 20mg pills where can i buy prednisone online buying ventolin in usa buy lasix online australia sildenafil citrate 100mg pills price of advair diskus generic robaxin buy tadalafil

sildenafil 20 mg price comparison tadalafil 20 where to buy female viagra prednisone generic seroquel xr

robaxin 750 mg tabs sildenafil 100mg uk paypal order prednisone 100g online without prescription ventolin prices over the counter amoxicillin 500mg lasix 20 mg pill buy indocin 75 mg generic for advair diskus viagra for women sale where to get prednisone trazodone coupon generic toradol buy tadalafil prescription drug diclofenac tadalafil 20 mg best price tadalafil 10 mg buy baclofen uk amoxicillin 500 generic for benicar seroquel xr generic

sildenafil citrate tablets 100mg buy generic propecia uk

female viagra where to buy indomethacin indocin how to buy amoxicillin online anafranil pills for sale prednisone 543 levitra online prozac buy online trazodone cost lasix 40 price medication diclofenac 75mg

tadalafil paypal lasix pills 20 mg buy toradol online indocin 50 mg buy tadalafil

can you buy toradol over the counter robaxin buy best pharmacy buy tadalafil prednisone for sale online benicar from canada

toradol 70 mg tablet price of diclofenac gel generic for prozac advair diskus cost of generic lasix

buy toradol tadalafil 5mg anafranil price buy robaxin amoxicillin 400mg cost indocin 75 mg prednisone 20 buy diclofenac ampicillin cost generic for cymbalta

seroquel coupon prednisone tablets benicar hct generic buying toradol online

viagra pills order viagra manufacturers coupon viagra pills buy

where to get prozac cost for 90 seroquel 200mg tablets amoxicillin 250 generic cialis amoxicillin 500mg capsules advair diskus cortisol prednisone ventolin hfa 90 mcg inhaler sildenafil price 100mg buy robaxin tadalafil 100mg online price for diclofenac gel synthroid brand 88 mcg buy generic propecia uk trazodone 50mg buy toradol lasix 30 mg anafranil generic baclofen buy kamagra tablets

prednisone anafranil 5mg levitra 2.5mg cost advair diskus for sale generic robaxin how to get amoxicillin without prescription amoxicillin 500 no prescription where to buy ventolin

where can i buy prednisone online without a prescription generic sildenafil pills generic anafranil tadalafil united states trazodone 50 mg ampicillin tablet

kamagra soft tabs tadalafil 5mg generic cialis buy toradol tablets buy anafranil

tadalafil 20 buy indocin without a prescription seroquel 50 mg propecia generic canada 20 amoxicillin 500mg cost benicar hct buy tadalafil generic viagra cialis

buy baclofen from india where can i buy diclofenac over the counter indocin medication prozac mexico cost of propecia generic how to get accutane online sildenafil 100mg where can i buy ampicillin

kamagra tablets online cymbalta generic brand trazodone 50mg amoxicillin 500 buy tadalafil benicar generic price levitra online where can you buy female viagra prednisone 5 mg lasix buy

sildenafil tablets 100 mg benicar hct women's viagra pink pill baclofen 641956 buy robaxin generic seroquel 50 mg cymbalta generic cost ampicillin tablet 1mg buy ventolin online canada diclofenac gel otc

discount tadalafil prednisone amoxicillin 10mg prednisone 20 mg baclofen 10mg

canadian online pharmacy prednisone where to buy female viagra uk 40 mg amoxicillin prednisone buy without prescription buy accutane online buy kamagra online buy levitra ventolin usa over the counter buy anafranil online uk buy tadalafil 20

can i buy kamagra over the counter prednisone for sale prednisone 10 mg amoxicillin 500 female pink viagra 500 mg robaxin buy diclofenac cialis generic advair pill generic baclofen 10 mg

toradol prescription buy ampicillin online buying prednixone for animals baclofen 25mg kamagra pill canadian online pharmacy prednisone cymbalta generic how to buy amoxicillin online levitra 20 mg cost generic cialis tadalafil trazodone 5 mg seroquel 300 mg generic tadalafil 2.5 mg buy synthroid amoxicillin 875mg buy diclofenac cost of anafranil 75 mg indocin medication buy generic prozac sildenafil 100mg coupon

levitra 10 seroquel xr generic tadalafil 10 amoxicillin 500 mg price ampicillin sulbactam can you buy advair over the counter

video effect of viagra synthetic viagra side effects buy discount viagra
viagra cost 100mg blue viagra pill 100

erfahrungen levitra 20mg comprar vardenafil viagra without prescription assunzione levitra 10 mg se puede combinar cialis y levitra

generic viagra sold in the united states dapoxetine
and viagra forum levitra 20mg price 120 mg viagra viagra online auf rechnung bestellen

low blood pressure after viagra original viagra online
uk female viagra price barzellette sul viagra le prix viagra 50
mg

viagra allo mam tekst pesni cialis levitra eller viagra buy generic viagra terazosin viagra interaction viagra for sale in houston tx

viagra prescription cost cheap viagra online where to buy viagra online

viagra and chemotherapy canada online pharmacy kann man viagra in holland kaufen

vardenafil haltbarkeitsdatum generic levitra levitra effetti
collaterali

is cialis better than flomax for bph where to buy cialis beipackzettel cialis 20mg

Hi! les risques du cialiscialis generic form buy cialis spain cialis free samplearaujo cialis buy cialis online vipps

cialis generic price how much does cialis
cost cialis pills sale

Hi! testogel and cialisdosage directions for cialis how to buy cialis cialis sicuro internetcialis how long to act buy generic cialis sale

tadalafil vardenafil sildenafil best price on viagra 50mg viagra side effects blood in stool

Hi! lushan.me cialis anfangsdosiscialis wirkungseintritt buy cialis online canada cialis tablets costhow soon cialis works cialis sale

best generic cialis Side Effects For Cialis 18707769 cialis online india
cialis without a prescription when will cialis go generic cheap cialis
online
cialis for women Generic Cialis At Walmart 34351271 buy cialis professional
canadian pharmacy online cialis generic for cialis how to buy cialis
buy generic cialis professional Price Of Cialis 104430206 cialis 10 mg

cialis 20mg buy Price Of Generic Cialis 43574083 get cialis online
coupon for cialis buy cialis side effects of cialis for daily use
best online pharmacy to buy cialis Cialis Without A Doctor's Prescription 53030797 buy cialis tadalafil
generic cialis tadalafil best buys Cialis Professional 121596580 order cialis online
best price on cialis generic name for cialis generic
cialis from india

cost of cialis 5 mg when will generic cialis be available cialis 20 mg buy online

cheap viagra canada pharmacy viagra viagra prices costco viagra effect on women where can i buy
viagra pills

cialis 10mg price cialis generic price buying cialis from canada

Wonderful goods from you, man. I have understand your stuff previous to and you are just extremely excellent.
I actually like what you have acquired here, really like what you are stating and the way in which you say it.
You make it entertaining and you still care for to keep it wise.

I can't wait to read much more from you. This is actually
a tremendous site.

Hi! minimum dosage of cialiswanneer loopt patent cialis af how do i buy cialis siti sicuri dove acquistare cialisinternetapotheke cialis buy cialis and levitra online

lushan.me cialis for femalescialis assunzione pasti Health cialis steroid profileright dose of cialis Cialis Sale ab wann wirkt cialis 5mg

Levitra Che Cos'E https://buyciallisonline.com/# - buy cialis canada pharmacy Le Cialis Est Il Vraiment Efficace cheap cialis online canadian pharmacy Direct Zentel 400mg

选 `origin/android-goldfish-4.14-dev` 分支更合理,不过问题不大