<Irenes[m]>
Hi! So I asked this over in the Pine64 #offtopic channel and was told somebody here had done previous work on it.
<Irenes[m]>
I'm interested in figuring out how the community can use secure boot on the Allwinner A64.
<Irenes[m]>
I had initially thought that the boot0 that the chips are distributed with doesn't actually implement secure boot, but apparently that's just because the open-source version purporting to be that code is incomplete?
<Irenes[m]>
I was pointed at the sunxi wiki pages on SID registers and TOC0
<Irenes[m]>
which I have now read
<Irenes[m]>
and apparently the biggest unanswered questions are about how to actually burn the e-fuses?
<Irenes[m]>
anyway, I'd love to sync up with people who have worked on this before, if there are any here
<Irenes[m]>
although I don't know how much time I'll actually have to work on this before mid-Q1
Mangy_Dog has quit [Ping timeout: 268 seconds]
vagrantc has quit [Quit: leaving]
<smaeul>
Irenes[m]: I don't think actually burning the efuse is hard, just nobody wants to do it
<smaeul>
because unless you use a several-year-old ruby script to generate properly-formatted files, you've turned your device into a brick
<buZz>
nobody wants secure boot beside microsoft and intel
<smaeul>
buZz: very not true. secure boot is useful when you control the keys, which you do in this case
<buZz>
ok :)
<buZz>
then have at it
<buZz>
wait, allwinner gave their root keys away?
<ezdiy>
>when you control the keys
<ezdiy>
why is it this is almost never the case when secure boot is actually deployed on ARM?
<smaeul>
buZz: there are no keys programmed by default. the hash of the public key is also an eFuse
<buZz>
ahahahah
<buZz>
right, that brings me back to my initial statement
<smaeul>
especially with devices like the pinephone, you want secure boot, or evil-maid style attacks are trivial
<ezdiy>
evil maid is my favorite security tin foil fetish
<smaeul>
it's even more of a problem because you can trivially boot to an external sd card
<ezdiy>
clearly she never heard of persistence in far more convenient places
<buZz>
like SIM cards that run untrusted software that can be remote flashed without user noticing
<buZz>
or same @ baseband radios
<buZz>
mainly the SIM card is a easy entry on all phones
<smaeul>
point is, chain of trust has to start with the (hardware) bootloader, or you're owned, even with FDE
<buZz>
no, bootloader does not affect anything to the code running on SIM or baseband
<ezdiy>
i dont really care. i just wish vendors were forced to give me the key when asked for, make it some sort of law
<smaeul>
buZz: except, say, the pinephone, where it's isolated over USB, and can be trivially switched off
<buZz>
smaeul: you cannot switch off behaviour patterns of humans
<ezdiy>
buying locked hw feels very wrong, as it feels like buying only a license to use it in pre-approved ways
<ezdiy>
im fine with losing warranty, its not all that hard
<buZz>
i want to see warranty become a option by law
<buZz>
that we're able to buy any and all project with 'warranty void' from day0 , for a 20-50% discount
<buZz>
hell, on some products that could be 90%
<buZz>
like those macintapples
<Irenes[m]>
yeah, so I personally very much do want to have secure boot, but obviously with keys I personally control, for my personal devices
<ezdiy>
on the other hand, the sport is fun
<Irenes[m]>
I 100% agree that corporate-controlled secure boot is evil
<ezdiy>
clearly one of the days when hacking can be ethical
<ezdiy>
jailbreaking that is
<buZz>
Irenes[m]: well, get a 5 usd A64 devboard, and go try to get it working?
<Irenes[m]>
yes absolutely, I'm doing that
<buZz>
cool :) which devboard are you getting?
<Irenes[m]>
not sure yet! I had heard that somebody in here had tried this previously, so I was hoping to sync with them before I spend (more) money
<buZz>
ah , could be
<buZz>
have a name? :)
<Irenes[m]>
no, sorry, it was somebody's fuzzy memory of a conversation from apparently about two years ago
<buZz>
Wizzup: does maemo leste use secure boot yet? :D
<smaeul>
I know MoeIcenowy has done secure boot on H3, and I think apritzel (rarely here) has done it on A64
<ezdiy>
Irenes[m]: re burning efuses: an interesting approach used with pc hw sometimes is wire the fuse to intrusion detection. switch that short-circuits something when you open the device wrong.
<Irenes[m]>
oh that's fun
<ezdiy>
if you know how to open it, great, your efuse is fine. but most won't know how, so it becomes bomb disposal.
<buZz>
maybe zeptobars also has a delidded A64?
<smaeul>
ezdiy: these aren't really that kind of fuse
<ezdiy>
smaeul: :>
<smaeul>
it's just a boring old one-time-programmable (EE)PROM
<ezdiy>
so it is in tpm intrusion detection
<buZz>
hmm, not that i see
<ezdiy>
except in there its a ram that forgets
<buZz>
smaeul: is it really eeprom? i see 'fuses' implemented in flash so superoften
<Irenes[m]>
burning these indiscriminately would certainly make it unbootable
<smaeul>
buZz: well, only AW knows exactly how it works in hardware. we just know the software interface
<buZz>
until zepto lets loose the acid :D
<Irenes[m]>
I'm not sure what threat models that's actually useful for; it does defeat evil maid, in that it tells you the device was tampered with
<Irenes[m]>
and that may be an appropriate trade-off for some people
<buZz>
Irenes[m]: it doesnt tell you that really
<buZz>
'it wont boot' can have 98374987398749873843 reasons
<Irenes[m]>
true lol
<buZz>
you wanna know one of my fav methods of detecting bad actors?
<Irenes[m]>
sure
<buZz>
leave a 5 usd bitcoin wallet on your device
<buZz>
no passwd
<Irenes[m]>
lol
<Irenes[m]>
fun
<buZz>
cheap, easy, reliable
<buZz>
and decentrally visible
<ezdiy>
also screams honeypot, nah
<ezdiy>
leave $5k, have a bot online racing to double spend it with higher fee and broadcast faster the moment you see attacker's tx out
tllim has joined #linux-sunxi
<ezdiy>
most dont have that kind of sophisticated setup to try the same, they'd most likely send the tx via tor so would be crippled in the race
<Wizzup>
buZz: restricted boot?
<buZz>
Wizzup: eh, secure boot where you only allow your bootloader to start binaries that are signed with $arbitrarykey
<ezdiy>
in theory 'security', in practice vendor lock-ins and DRM
<Irenes[m]>
to reiterate, what I specifically want to do is signed boot where I control the key
camus has joined #linux-sunxi
<Irenes[m]>
which should be possible in principle with SoCs that ship with the e-fuses blank
<buZz>
ezdiy: hehe that bot+doublespend trick probably totally would work
<buZz>
if you can time it right
kaspter has quit [Ping timeout: 248 seconds]
camus is now known as kaspter
<ezdiy>
buZz: its still nontrivial (~5% if your setup is good and his not) chance you'll lose the money tho. the thing about petty cash lying on the sidewalk is almost nobody bothers to pick it up
<buZz>
ezdiy: well, stuff like checklocktimeverify now exists
<buZz>
so you could keep the money locked regardless of who owns access to the keys
<ezdiy>
what of it? either the inputs are spendable or not
<buZz>
i like programmable money, its tons of fun
<buZz>
ezdiy: right, but you could force them to wait 1-2 years
<buZz>
although that would remove the benefit of early detection i guess
<ezdiy>
well, it would postpone the detection to certain point of time. not sure if its advisable, as the attacker would have more time to prepare, especially if its interesting kind of money
<megi>
smaeul: evel maid is actually less of a problem on Allwinner, because you can bring your chain of trust with you on your SD card
<megi>
evil
<ezdiy>
you can evil maid any allwinner just with a teaspoon
<ezdiy>
secureboot or not
<megi>
heh? :)
<ezdiy>
make brom fail read emmc, jumps to fel
<megi>
and that will help what?
<ezdiy>
that is assuming the chain lives on mmc
<megi>
chain lives on SD that you trust
<ezdiy>
well, once in fel you remove the spoon and can now boon
<ezdiy>
*boot
<ezdiy>
megi: of course if whatever is to be attacked isnt there to begin with, thats entire different story. once again, no secure boot necessary
<Irenes[m]>
so, like, to me
<ezdiy>
carrying the sd with you is definitely for the best
gaston1980 has quit [Quit: Konversation terminated!]
ChriChri_ has joined #linux-sunxi
<Irenes[m]>
carrying the SD with you does help, but if an attacker can run arbitrary code on the device, I don't want to assume that they can't booby-trap it in some way that will help them the next time I boot it myself and unlock the FDE
<megi>
also people probably carry their phones on themselves more than their notebooks, so less of a chance for tampering anyway
<Irenes[m]>
maybe with a rollback attack or something
ChriChri has quit [Ping timeout: 252 seconds]
ChriChri_ is now known as ChriChri
<ezdiy>
i really liked old huawei mediatek
<buZz>
Irenes[m]: megi's argument was 'SD always goes first, so just take it with you''
<megi>
right
<ezdiy>
they had fun backdoor where the spl just read arbitrary .bin from sdcard, giving it priority over mmc. one doesn't see that often nowadays.
<ezdiy>
with that you can truly do "secure by carrying your sd in pocket". well, except for maybe baseband.
<buZz>
and simcard ;)
<buZz>
they are two seperate platforms, both 100% untrustable
<ezdiy>
that one usually goes extra leg to gain arbitrary wries to host os
<Irenes[m]>
buZz: yeah, I get that
<ezdiy>
if baseband is stupid to let it, i guess sim can be made pretty evil
<ezdiy>
not that anyone bothered
<Irenes[m]>
it goes first, but an attacker could put their own SD in
<ezdiy>
buZz: sim card is just that thing giving answers to let me use cell tower. why trust it for anything else?
<ezdiy>
who really cares whatever runs on it, as long it stays on it
<buZz>
ezdiy: its literally executing java programs on your behalf
<ezdiy>
so?
<buZz>
which are remote flashable
<buZz>
and have access to SMS etc
<ezdiy>
who cares about sms? those aren't yours to begin with
<ezdiy>
but your cell operators
<buZz>
in android afaik it has access to your /sdcard aswell
<ezdiy>
they can read those in plain anyway
<buZz>
and mic, display, speaker
<megi>
tell that to the banks overusing them for 2FA
<Irenes[m]>
yeah I basically agree that any realistic security model needs to assume the SIM can do whatever it wants, including malicious stuff
<buZz>
only safe cellphone is one without radios, imho
<Irenes[m]>
yes, it can cause real harm, but that's kind of by design and the reason that phones have SIMs
<Irenes[m]>
yeah
<ezdiy>
buZz: mic, display, speaker? now that would be a sim midlet i'd like to see.
<buZz>
lets see if i can find that talk
<ezdiy>
not saying its impossible, its just about tricking the baseband to do something stupid
<ezdiy>
boy and are basebands stupid
<buZz>
plus -also- remote flashable
<buZz>
with again, zero notification to the user
<ezdiy>
but why?
<ezdiy>
sim card is not users
<ezdiy>
its cells operators
<ezdiy>
its not your business what it itself does
<ezdiy>
its definitely your business what it does to host os
<ezdiy>
if you tell baseband to turn off stk, and it does something behind your back
<ezdiy>
buZz: bottom line is that those bugs are fairly common
popolon has quit [Quit: WeeChat 2.7]
<buZz>
indeed
<ezdiy>
though usually used for dumping sK
<ezdiy>
for sim cloning, private exploits per carrier
<buZz>
so common , that it leaves gsm 100% untrustable
<ezdiy>
you mean was it ever trusted?
<buZz>
ezdiy: i think ppl did think of it as trustable as landlines once yeah
<ezdiy>
first, gsm is dead. second, you use 3G/4G only because its only viable means for portable internet.
<ezdiy>
just turn off rest of the junk
<ezdiy>
nobody sane uses it.
<buZz>
right,
<buZz>
i just dont use it -at all-
<buZz>
it never gave me any joy to be 24/7 harassable
<buZz>
so -paying- for the priviledge of harrassment quickly became a no-no to me
<ezdiy>
well, thats a bit overbearing. usually people just turn off stk.
<ezdiy>
AT^STSF=0
<buZz>
you pay for harassment voluntary?
<ezdiy>
so sim card cant tell baseband to do silly stuff, like placing calls on its own
<buZz>
well, baseband is still 100% remote flashable
<ezdiy>
its been problem in the past with toll numbers malware
<ezdiy>
buZz: just an ota
<ezdiy>
thats up to you whether you want it
<ezdiy>
but its rare for ota updates to get compromised, at least for now
<buZz>
ota does -not- notify user
<ezdiy>
it does, on stock phone even
<ezdiy>
depends on vendor tho
<buZz>
sure, not enough ppl have osmocombb hardware ;)
<ezdiy>
some are nice enough, some dont
<buZz>
TI calypso platform is pretty much 100% known
<ezdiy>
typically people pay attention to ota for entirely different reason, because you need to keep base os/ota in sync. ie if you run frankenrom, you typically keep ota updates off
<buZz>
also, you can flash baseband straight from malicious android apk's aswell
<ezdiy>
which paradoxically introduces potential bugs, as now you made potentially fatal problems unfixable
<buZz>
mmm afk, bbl
<ezdiy>
buZz: you mean get root on vulnerable kernel, then send at commands because you dont have perms to do so otherwise?
<ezdiy>
im not insisting those bugs dont exist, just thats its the usual "old bugs".
<ezdiy>
and needlessly complicated if you're going to break into an old phone, as far more streamlined routes exist for htose
megi has quit [Ping timeout: 268 seconds]
lurchi_ is now known as lurchi__
<buZz>
ezdiy: oh totally agree, there's nothing new
<buZz>
we just keep showing old stuff into more devices quicker and quicker :)
<ezdiy>
i dont know, at least on android things are vastly improving
lurchi__ is now known as lurchi_
<buZz>
dont they still sell android 4 devices?
<buZz>
hmm 5.1 on first random 50 usd aliexpress tablet
<buZz>
most seem 6 or higher
<ezdiy>
8 is generally considered "can lock it down reasonably well"
<ezdiy>
ie write selinux policies, override app perms, while keeping it hacked up with xposed patches to get rid of advertising/microtransaction crap
<ezdiy>
in a lot of ways, android system really resembles pcs in their heyday
<ezdiy>
insanely customisable, secure only if you track all the moving parts
<wens>
megi: Yeah. looks like the fix is in Linus's tree now: 7de7de7ca0ae
aloo_shu has quit [Ping timeout: 268 seconds]
<tllim>
@Irenes, check with apritzel, he has tried out burn efuse on PINE A64 board
<KotCzarny>
one could circumvent burnt efuse by using fel, if my memory isnt playing tricks
dddddd has quit [Remote host closed the connection]
cnxsoft has joined #linux-sunxi
cnxsoft1 has quit [Read error: Connection reset by peer]
ldevulder_ is now known as ldevulder
tllim has quit [Read error: Connection reset by peer]
florian_kc has joined #linux-sunxi
florian_kc has quit [Ping timeout: 268 seconds]
florian_kc has joined #linux-sunxi
hellsenberg has joined #linux-sunxi
arnd_ has joined #linux-sunxi
suprothunderbolt has quit [Ping timeout: 246 seconds]
niceplaces has joined #linux-sunxi
Net147_ has joined #linux-sunxi
lynxis_ has joined #linux-sunxi
embed-3d has joined #linux-sunxi
arti_ has joined #linux-sunxi
niceplaces has quit [Read error: Connection reset by peer]
montjoie_ has joined #linux-sunxi
niceplaces has joined #linux-sunxi
juri__ has joined #linux-sunxi
souther_ has joined #linux-sunxi
nosliot has joined #linux-sunxi
lykt_ has joined #linux-sunxi
mru_ has joined #linux-sunxi
kilobyte_ has joined #linux-sunxi
DuClare_ has joined #linux-sunxi
djakov_ has joined #linux-sunxi
deesix_ has joined #linux-sunxi
ec0_ has joined #linux-sunxi
karlp1 has joined #linux-sunxi
agraf_ has joined #linux-sunxi
gsz has joined #linux-sunxi
indy_ has joined #linux-sunxi
black_ink_ has joined #linux-sunxi
cyrozap-ZNC has joined #linux-sunxi
fl__0 has joined #linux-sunxi
Turl has joined #linux-sunxi
specing_ has joined #linux-sunxi
captaini- has joined #linux-sunxi
Net147 has quit [*.net *.split]
fl_0 has quit [*.net *.split]
niceplace has quit [*.net *.split]
martinayotte has quit [*.net *.split]
ec0 has quit [*.net *.split]
zumbi has quit [*.net *.split]
montjoie has quit [*.net *.split]
sunshavi has quit [*.net *.split]
NekoMay has quit [*.net *.split]
DonkeyHotei has quit [*.net *.split]
lykt has quit [*.net *.split]
deesix has quit [*.net *.split]
cyrozap has quit [*.net *.split]
indy has quit [*.net *.split]
djakov has quit [*.net *.split]
juri_ has quit [*.net *.split]
agraf has quit [*.net *.split]
karlp has quit [*.net *.split]
kilobyte has quit [*.net *.split]
Turl_ has quit [*.net *.split]
DuClare has quit [*.net *.split]
mru has quit [*.net *.split]
souther has quit [*.net *.split]
bbrezillon has quit [*.net *.split]
specing has quit [*.net *.split]
embed-3d_ has quit [*.net *.split]
lynxis has quit [*.net *.split]
captainigloo has quit [*.net *.split]
hell__ has quit [*.net *.split]
arti has quit [*.net *.split]
black_ink has quit [*.net *.split]
arnd has quit [*.net *.split]
souther_ is now known as souther
agraf_ is now known as agraf
arnd_ is now known as arnd
hlauer has joined #linux-sunxi
specing_ is now known as specing
bbrezillon has joined #linux-sunxi
juri__ has left #linux-sunxi [#linux-sunxi]
martinayotte has joined #linux-sunxi
DonkeyHotei has joined #linux-sunxi
juri_ has joined #linux-sunxi
NekoMay has joined #linux-sunxi
hellsenberg is now known as hell__
camus1 has joined #linux-sunxi
kaspter has quit [Ping timeout: 248 seconds]
camus1 is now known as kaspter
Asara has quit [Ping timeout: 245 seconds]
gaston1980 has joined #linux-sunxi
mru_ has left #linux-sunxi [#linux-sunxi]
mru has joined #linux-sunxi
florian_kc has quit [Ping timeout: 250 seconds]
djakov_ is now known as djakov
karlp1 has left #linux-sunxi [#linux-sunxi]
karlp has joined #linux-sunxi
florian_kc has joined #linux-sunxi
megi has joined #linux-sunxi
fl__0 is now known as fl_0
sunshavi has joined #linux-sunxi
tnovotny has joined #linux-sunxi
rzerres has quit [Read error: Connection reset by peer]
rzerres has joined #linux-sunxi
Mangy_Dog has joined #linux-sunxi
victhor has joined #linux-sunxi
aloo_shu has joined #linux-sunxi
goldensye has joined #linux-sunxi
montjoie_ is now known as montjoie
suprothunderbolt has joined #linux-sunxi
Asara has joined #linux-sunxi
AneoX has joined #linux-sunxi
JohnDoe_71Rus has joined #linux-sunxi
hairstorm has quit [Quit: hairstorm]
dddddd has joined #linux-sunxi
deesix_ is now known as deesix
MangyDog has joined #linux-sunxi
MangyDog has quit [Remote host closed the connection]
Mangy_Dog has quit [Ping timeout: 252 seconds]
ldevulder_ has joined #linux-sunxi
Mangy_Dog has joined #linux-sunxi
ldevulder has quit [Ping timeout: 246 seconds]
JohnDoe1 has joined #linux-sunxi
JohnDoe_71Rus has quit [Ping timeout: 248 seconds]
reinforce has quit [Quit: Leaving.]
return0__ has joined #linux-sunxi
return0e has quit [Ping timeout: 245 seconds]
lurchi_ is now known as lurchi__
<rellla>
hi, can anybody give me a hint, why 5.5-rc2 isn't working with on a cubieboard2 with sunxi_defconfig (nearly): https://pastebin.com/raw/cMYJN0VM