SPM Trick: Kill your Uzebox in 1 sec!

Topics related to the API, programming discussions & questions, coding tips, bugs, etc. should go here.
Post Reply
User avatar
uze6666
Site Admin
Posts: 4823
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

SPM Trick: Kill your Uzebox in 1 sec!

Post by uze6666 »

Ok I've got you attention :). I'll play the devils advocate a bit here. What if someone write (maliciously or not) a HEX that would use SPM instructions in an endless loop all over the flash memory? It's clear that at 10K max rewrites, you are gonna kill your chip in no time. Since I'm an incurable internet paranoid, I'd suggest you protect yourself against that and set the protection fuse on you mega644! Eventually we will have a SD bootloader and it should be (with the ISP) the only way to 'wear' your chip.

Uze
antibyte
Posts: 19
Joined: Mon Aug 25, 2008 10:36 pm

Re: SPM Trick: Kill your Uzebox in 1 sec!

Post by antibyte »

Its time for Norton Antivirus Uzebox Edition :lol:
User avatar
Flecko
Posts: 158
Joined: Mon Jan 05, 2009 11:50 pm

Re: SPM Trick: Kill your Uzebox in 1 sec!

Post by Flecko »

I understand your concern Uze, but this argument comes up at work a lot for me. We do datalogging to EEPROM on our embedded boards and it inevitable comes out that "Oh No....we only have 10-20k write cycles on the EEPROM. Won't it wear out?" And yes, its a possibility. But I mean, if someone writes a malicious program for the Uzebox, there is only one filter to stop it: users.

Abusing the hardware is just something you can't really protect against. And I mean, if worst comes to worst, you have to buy another 5-8$ chip and snap it on your uzebox. I say its not that big a deal. I have a backup 644 just in case I need it anyways. Its not like you have to throw the whole board away.

And besides...who here would write a bad program like that anyways? ...at least not intentionally, right? :D
User avatar
Jhysaun
Posts: 214
Joined: Tue Nov 04, 2008 12:32 am

Re: SPM Trick: Kill your Uzebox in 1 sec!

Post by Jhysaun »

uze6666 wrote:What if someone write (maliciously or not) a HEX that would use SPM instructions in an endless loop all over the flash memory?
You guessed my secret game. Congrats :D


>J
Lerc wrote:I intend to use my powerful skills of procrastination to ensure that when I get to making things, the chips will be available.
User avatar
uze6666
Site Admin
Posts: 4823
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: SPM Trick: Kill your Uzebox in 1 sec!

Post by uze6666 »

Its not like you have to throw the whole board away.
True...anyway, I just had to mention it. Kind of a disclaimer... ;)
You guessed my secret game. Congrats :D
Uh oh, the first banned user! ... :lol:

Uze
DavidEtherton
Posts: 252
Joined: Tue Dec 02, 2008 12:38 am
Location: Carlsbad, California (USA)

Re: SPM Trick: Kill your Uzebox in 1 sec!

Post by DavidEtherton »

uze6666 wrote:Ok I've got you attention :). I'll play the devils advocate a bit here. What if someone write (maliciously or not) a HEX that would use SPM instructions in an endless loop all over the flash memory? It's clear that at 10K max rewrites, you are gonna kill your chip in no time. Since I'm an incurable internet paranoid, I'd suggest you protect yourself against that and set the protection fuse on you mega644! Eventually we will have a SD bootloader and it should be (with the ISP) the only way to 'wear' your chip.

Uze
Another option would be to run an "untrusted" hex under the emulator first. It currently warns about EEPROM access but not SPM just yet.

-Dave
User avatar
Jhysaun
Posts: 214
Joined: Tue Nov 04, 2008 12:32 am

Re: SPM Trick: Kill your Uzebox in 1 sec!

Post by Jhysaun »

Another option would be to run an "untrusted" hex under the emulator first. It currently warns about EEPROM access but not SPM just yet.
I'll have to work vigilantly to release it before the next emulator release now that I know this. :D

Anyway in all seriousness, is there a way to accidentally do something like this in C, or just if your doing assembly?

Is there any chance that if something runs on the emulator it could crash the actual hardware?
Lerc wrote:I intend to use my powerful skills of procrastination to ensure that when I get to making things, the chips will be available.
DavidEtherton
Posts: 252
Joined: Tue Dec 02, 2008 12:38 am
Location: Carlsbad, California (USA)

Re: SPM Trick: Kill your Uzebox in 1 sec!

Post by DavidEtherton »

Jhysaun wrote:
Another option would be to run an "untrusted" hex under the emulator first. It currently warns about EEPROM access but not SPM just yet.
I'll have to work vigilantly to release it before the next emulator release now that I know this. :D

Anyway in all seriousness, is there a way to accidentally do something like this in C, or just if your doing assembly?

Is there any chance that if something runs on the emulator it could crash the actual hardware?
Definitely, because I emulate only a small percentage of the real hardware on an AVR8, just enough to get working input, video, and sound.

But I would like to think we're a small enough group with narrow enough interests that we'd be free of any malice.

-Dave
Post Reply