Our thinking

How the Meltdown and Spectre exploits work in layman’s terms

Thanks to Joe Fitz (Twitter: @securelyfitz) who has written a relatively easy to understand overview about how the recent #meltdown and #spectre bugs work in layman’s terms:

Let’s say you go to a library that has a ‘special collection’ you’re not allowed access to, but you want to to read one of the books.

You go in and go to the librarian and say “I’d like special book #1, and the Sue Grafton novel that corresponds to the first letter of page 1 of that book”.

The librarian dutifully goes and gets special book #1, looks at page 1, sees ‘C’, and also grabs ‘C is for Corpse’, and comes back to the desk, but does not show you the books.

The librarian scans your card, then scans the first book, and says “Sorry, you don’t have access to this book, let’s start over.” But puts the books on the nearby re-shelve cart instead of back on the shelf.

In response you say “I’d like to borrow ‘A is for Alibi’ and the librarian responds “Just a moment while I get that”. You interrupt and ask for ‘B is for Burgler’ and the librarian responds “Just a moment while I get that” again.

When you interrupt again, and say “I’d also like C is…” the librarian interrupts you to say ‘Oh I have that one right here on the cart!”.

You say “Great! But actually I don’t want any books. You can put all those back!” and write down ‘C’ in your notebook.

The dutiful librarian re-shelves all the books and then you repeat the process… For every single letter on every page in special book #1. The librarian is especially dutifully and luckily fast, so this only takes you a few moments.

Let’s try fixing it by having a separate shelf, reshelving rack, librarian, and line for the special collection. It solves the problem, but all the people who have access to and use the special collection complain about how it takes 5 to 30% longer to get their books.

So, the books are memory. The special collection is operating system or other programs memory. The reshelving rack is cache and/or register file. The librarian is the page management. It’s not a perfect analogy, but it describes it in non-technical terms.

Leave a Reply

Your email address will not be published. Required fields are marked *