, 19 tweets, 5 min read
My Authors
Read all threads
=========================
The Life and Incredible Adventures
of One QEMU Bug
(Which I Finally Fixed)
=========================

A thread [1/n]
_Disclaimer_

That is not for trolling, that is for LOL.
So here I omit the names of QEMU maintainers that were involved in these adventures.
I will call them Mr1 and Mr2.

Have fun!

[2/n]
This bug was born in July 2015, in a lovely QEMU file called hw/ide/core.c.

It was not very serious or critical like others. So you would not be very frustrated if you meet it on the way.

I will not speak about its father. Let me keep the intrigue till the end.

[3/n]
This bug couldn't read or write (what a pity!).

It only asserted that the size of successful DMA transfers handled in ide_dma_cb() should be multiple of 512 (the size of a sector).

... 4 years later...

[4/n]
One misty morning I logged into my fuzzing machine wondering why syzkaller hadn't given any useful results for several weeks.

I've found QEMU crashed. Wow, syzkaller learned how to destroy its own environment :-/

[5/n]
It looked like QEMU guest-to-host DoS, so I prepared the fixing patch and decided to send it to QEMU security team.

Yes, I'm doing responsible disclosure, folks :-)

Then the crawling fun began.

[6/n]
[Jun 20] me: sent PoC and patch to QEMU security team

[Jun 26] me: hey, friendly ping!

[Jul 05] secteam: Please feel free to send the patch upstream

me: no problem, sent PoC and patch to the public ML
lists.nongnu.org/archive/html/q…

[7/n]
[Jul 15] me: public friendly ping

[Jul 16] Mr1: hey Mr2, it's for you!

Mr2: I'm aware of the patch. It's on the list to investigate today.

/* 10 days passed... Huh? */

[8/n]
[Jul 26] Mr2: oh, this is fun. Not gonna take your fix. Whole code should be overwritten. I can worry about a proper fix for QEMU 4.2+.

[Jul 27] me: hum, okay... Feel free to add me to CC, I can review the patches and test them with fuzzing!

/* 3.5 months passed... */

[9/n]
[Nov 6] me: I'm pointing politely to this issue again.
It crashes qemu during syzkaller fuzzing.
Why don't you apply my commit and then do the refactoring later when you want?

[Nov 7] somebody in ML: do you want to rework the code yourself?



[10/n]
[Nov 7] me: huh, yes, I will take this task and return with a patch.

/* Grr. Challenge accepted! A week of development. */

[Nov 14] me: new patch fixing IDE

[Nov 21] Mr1: we have unit tests. First you improve them to cover all cases. Do according the IDE specification.

[11/n]
[Nov 27] me: okay, it looks like I can do that

lists.nongnu.org/archive/html/q…

/* More work done. I developed a new IDE fix and a shiny unit-test that also found an extra DMA emulation bug */

[Dec 16] me: sent the patch series

[12/n]
[Dec 19] Mr1: No, your unit-test is slow. Make it faster.

me: okay, I'll do that...

lists.nongnu.org/archive/html/q…

/* More work done. Rrrrr! It must be finished! */

[13/n]
[Dec 23] me: new fast shiny unit-test and fix
lists.nongnu.org/archive/html/q…

[Dec 24] Mr2: I've been out to lunch for a little while. I'll review these series before the end of the year.

[Dec 28] me: hello anybody?

/* Silence. Happy New Year! No review. LOL!!! */

[14/n]
Meanwhile my friends at 36C3 recommended to request a CVE to speed up the review process :-)

Nice idea! Red Had likes CVEs!

So MITRE allocated CVE-2019-20175 for this issue (with a DISPUTED tag).
cve.mitre.org/cgi-bin/cvenam…

[15/n]
[Jan 2] me: Happy New Year everyone! There is a CVE. How about review?

/* 5 days passed */

[Jan 7] Mr1: okay, it's fine now.

[Jan 8] me: thank you a lot! Let's wait for more reviews.

/* 2 weeks passed */

[16/n]
[Jan 22] me: pinging in the ML again about this fix and unit-test!

[Jan 22] Mr1: I asked Mr2. He promised to take a look very soon!

[Jan 23] Mr2: merged.
github.com/jnsnow/qemu/co…

WOW! Really?!!

[17/n]
And now can you guess who created this bug back in 2015?

Yes, it was Mr2. LOL!
Maybe that is why he was delaying the fix that killed it.

That was weird story.
Hope you liked it.
Happy end!
=========================

[n/n]
And let me thank Mr1 once again!
He is cool!

I would not be able to become a QEMU contributor without his help :-)

[n+1/n]
Missing some Tweet in this thread? You can try to force a refresh.

Enjoying this thread?

Keep Current with Alexander Popov

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!