All of lore.kernel.org
 help / color / mirror / Atom feed
From: Duncan <1i5t5.duncan@cox.net>
To: linux-btrfs@vger.kernel.org
Subject: Re: attacking btrfs filesystems via UUID collisions? (was: Subvolume UUID, data corruption?)
Date: Sun, 6 Dec 2015 04:06:00 +0000 (UTC)	[thread overview]
Message-ID: <pan$ddc43$45608356$bf638c60$d3fc60dc@cox.net> (raw)
In-Reply-To: 1449366680.3183.37.camel@scientia.net

Christoph Anton Mitterer posted on Sun, 06 Dec 2015 02:51:20 +0100 as
excerpted:

> You have things like ATMs, which are physically usually quite well
> secured, but which do have rather easily accessible maintenance ports.
> All of us have seen such embedded devices rebooting themselves, where
> you see kernel messages.
> That's the point where an attacker could easily get the btrfs UUID:
> [    0.000000] Command line: BOOT_IMAGE=/vmlinuz-4.2.0-1-amd64
> root=UUID=bd1ea5a0-9bba-11e5-82fa-502690aa641f
> 
> If you can attack such devices already by just having access to a USB
> port... then holly sh**...

There's actually a number of USB-based hardware and software vulns out
there, from the under $10 common-component-capacitor-based charge-and-zap
(charges off the 5V USB line, zaps the port with several hundred volts
reverse-polarity, if the machine survives the first pulse and continues
supplying 5V power, repeat...), to the ones that act like USB-based input
devices and "type" in whatever commands, to simple USB-boot to a forensic
distro and let you inspect attached hardware (which is where the encrypted
storage comes in, they've got everything that's not encrypted),
to the plain old fashioned boot-sector viruses that quickly jump to
everything else on the system that's not boot-sector protected and/or
secure-boot locked, to...

Which is why most people in the know say if you have unsupervised physical
access, you effectively own the machine and everything on it, at least
that's not encrypted.

There's a reason some places hot-glue the USB ports.  If you're plugging
anything untrusted into them... and that's a well known social engineering
hack as well, simply drop a few thumb drives in the target parking lot and
wait to see who picks them up and plugs them in, so they can call home... 
Pen-testers do it.  NSA does it.  It's said a form of that is how they
bridged the air-gap to the Iranian centrifuges...

If you haven't been keeping up, you really have some reading to do.  If
you're plugging in untrusted USB devices, seriously, a thumb drive with a
few duplicated btrfs UUIDs is the least of your worries!

>> The only real alternative if you don't like it is using a different
>> filesystem.

> As I've said, I don't have a problem with UUIDs... I just can't quite
> believe that btrfs and the userland cannot be modified so that it
> handles such cases gracefully.

As I implied,  UUIDs usage is so deeply embedded, fixing btrfs to not work
that way is pretty much impossible.  You'd be pretty much starting from
scratch and using some of the same ideas; it wouldn't be btrfs any longer.

> If not, than, to be quite honest, that would be really a major
> showstopper for many usage areas.

Consider the show stopped, then.

> And I'm not talking about ATMs (or any other embedded devices where
> people may have non-supervides access - e.g. TVs in a mall,
> entertainment systems in planes) but also the normal desktops/laptops
> where colleagues, fellow students, etc. may want to play some "prank".

As I said, if you're plugging in or allowing to be plugged in untrusted
USB devices, show's over, they're already playing pretty much any prank
they want, including zapping the hardware.  USB's now less trusted than a
raw Internet hookup with all services exposed.  The only controlling
factor now is the physical presence limitation, and if you're plugging in
devices you get for instance as "gifts just for trying us out" or
whatever, that someone mails to you... worse than running MS and
mindlessly running any exe someone sends you.


BTW, this is documented (in someone simpler "do not do XX" form) on the
wiki, gotchas page.

https://btrfs.wiki.kernel.org/index.php/Gotchas#Block-level_copies_of_devices


-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman


  reply	other threads:[~2015-12-06  4:06 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-04 12:05 Subvolume UUID, data corruption? S.J
2015-12-04 13:07 ` Hugo Mills
2015-12-05  3:28   ` Christoph Anton Mitterer
2015-12-05  5:52     ` attacking btrfs filesystems via UUID collisions? (was: Subvolume UUID, data corruption?) Christoph Anton Mitterer
2015-12-05 12:01     ` Subvolume UUID, data corruption? Hugo Mills
2015-12-06  1:51       ` attacking btrfs filesystems via UUID collisions? (was: Subvolume UUID, data corruption?) Christoph Anton Mitterer
2015-12-11 12:33       ` Subvolume UUID, data corruption? Austin S. Hemmelgarn
2015-12-05 13:19     ` Duncan
2015-12-06  1:51       ` attacking btrfs filesystems via UUID collisions? (was: Subvolume UUID, data corruption?) Christoph Anton Mitterer
2015-12-06  4:06         ` Duncan [this message]
2015-12-09  5:07           ` Christoph Anton Mitterer
2015-12-09 11:54             ` Duncan
2015-12-06 14:34         ` attacking btrfs filesystems via UUID collisions? Qu Wenruo
2015-12-06 20:55           ` Chris Murphy
2015-12-09  5:39           ` Christoph Anton Mitterer
2015-12-09 21:48             ` S.J.
2015-12-10 12:08               ` Austin S Hemmelgarn
2015-12-10 12:41                 ` Hugo Mills
2015-12-10 12:57                   ` S.J.
2015-12-10 19:42               ` Chris Murphy
2015-12-11 22:21                 ` Christoph Anton Mitterer
2015-12-11 22:32                   ` Christoph Anton Mitterer
2015-12-11 23:06                   ` Chris Murphy
2015-12-12  1:34                     ` S.J.
2015-12-14  0:28                       ` Christoph Anton Mitterer
2015-12-14  0:27                     ` Christoph Anton Mitterer
2015-12-14 13:23                       ` Austin S. Hemmelgarn
2015-12-14 21:26                         ` Chris Murphy
2015-12-15  0:35                           ` Christoph Anton Mitterer
2015-12-15 13:54                           ` Austin S. Hemmelgarn
2015-12-15 14:18                             ` Hugo Mills
2015-12-15 14:27                               ` Austin S. Hemmelgarn
2015-12-15 14:42                                 ` Hugo Mills
2015-12-15 16:03                                   ` Austin S. Hemmelgarn
2015-12-16 12:14                                     ` Christoph Anton Mitterer
2015-12-16 12:10                                   ` Christoph Anton Mitterer
2015-12-16 12:03                               ` Christoph Anton Mitterer
2015-12-16 14:41                                 ` Chris Mason
2015-12-16 15:04                                   ` Christoph Anton Mitterer
2015-12-17  3:25                                     ` Duncan
2015-12-18  0:56                                       ` Christoph Anton Mitterer
2015-12-22  2:13                                       ` Kai Krakow
2015-12-16 12:03                             ` Christoph Anton Mitterer
2015-12-17  2:43                               ` Duncan
2015-12-15  0:08                         ` Christoph Anton Mitterer
2015-12-15 14:19                           ` Austin S. Hemmelgarn
2015-12-16 12:56                             ` Christoph Anton Mitterer
2015-12-14 20:55                       ` Chris Murphy
2015-12-15  0:22                         ` Christoph Anton Mitterer
2015-12-11 23:14                   ` Eric Sandeen
2015-12-11 22:06               ` Christoph Anton Mitterer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='pan$ddc43$45608356$bf638c60$d3fc60dc@cox.net' \
    --to=1i5t5.duncan@cox.net \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.