News for hackers. Stuff that matters.
Re:Reverse engineering the Motorola Sensorhub: Part 1 by Ristovski on Monday July 05, 2021 @12:35AM (#27734658)
Author here. Thanks for posting! I have done some progress since, just didn't have much time to churn out a Part 2 (soon™, maybe)

Feel free to ask any questions

Re:Reverse engineering the Motorola Sensorhub: Part 1 by denysvitali on Monday July 05, 2021 @01:39AM (#27734917)
Please, post the Part 2 here on HN as soon as it out. This Part 1 was an amazing read!
Re:Reverse engineering the Motorola Sensorhub: Part 1 by Ristovski on Monday July 05, 2021 @04:56PM (#27741736)
I never anticipated people would find it this interesting which is why I barely got enough motivation to write the first part, so thanks for the encouragement!
Re:Reverse engineering the Motorola Sensorhub: Part 1 by mrlambchop on Monday July 05, 2021 @07:05AM (#27736622)
I'm curious if the use of little add on MCUs to cellphone designs like this opens up the opportunity to back door into the OS (such as reprogramming the MCU and sending malformed data into the kernel).

(re: weird bug where calling __aeabi_uidiv calls __exidx_end, could be hard fault handler getting invoked due to either div by 0 or incorrect linkage - that M0 has a few caveats around this instruction that I vaguely recall needing specific compiler settings for)

Great write-up BTW - subscribe!

Re:Reverse engineering the Motorola Sensorhub: Part 1 by Ristovski on Monday July 05, 2021 @04:34PM (#27741578)
> I'm curious if the use of little add on MCUs to cellphone designs like this opens up the opportunity to back door into the OS

I would say that the possibility is there - imagine a buffer overflow (or something as bad) in the driver running in the kernel.

However, getting the malicious firmware onto the MCU would be the difficult part. But I suppose even a purposefully "bad" batch of MCUs that have an extra core executing malicious code is not exactly science fiction in these times :P

> could be hard fault handler getting invoked due to either div by 0 or incorrect linkage

Interesting! I will look into this, cheers.

> Great write-up BTW - subscribe!

Thank you, much appreciated!

Re:Reverse engineering the Motorola Sensorhub: Part 1 by brutus1213 on Monday July 05, 2021 @06:38AM (#27736430)
Impressive work. In case someone wants more of an academic read, this is the earliest paper I could find: https://syslab.cs.washington.edu/papers/mobilehub-ubicomp15....

This paper did not introduce the sensorhub concept, but provides a good primer. If anyone has a paper on the actual concept, would be interested to know.

Re:Reverse engineering the Motorola Sensorhub: Part 1 by Ristovski on Monday July 05, 2021 @04:48PM (#27741684)
While doing my initial research, I stumbled upon a patent [0], where Motorola was listed as the applicant, it seems to be similar in concept to the current sensor hub implementation.

It also mentions "training" and more advanced processing (which would be ideal for the Qualcomm Hexagon DSP, shame it's practically unused on non-Pixel phones).

[0] https://patentimages.storage.googleapis.com/cc/ee/a2/e631f84...

Re:Reverse engineering the Motorola Sensorhub: Part 1 by mdaniel on Monday July 05, 2021 @03:37PM (#27741182)
> your favorite reverse engineering suite, like Ghidra

I'm thrilled at the adoption Ghidra has gotten, and glad the NSA used my tax dollars to contribute something useful to the world

I also loved the trick of using objcopy to turn the bytes into an ELF; that's just damn crafty

Re:Reverse engineering the Motorola Sensorhub: Part 1 by webgoat on Monday July 05, 2021 @04:13PM (#27741439)
Pretty sure they could have used the "set image base" option under the memory map view to accomplish the same thing, but it's still a cool workaround nonetheless.
Re:Reverse engineering the Motorola Sensorhub: Part 1 by Ristovski on Monday July 05, 2021 @04:38PM (#27741599)
You're right! However, I don't remember the exact issue, but Ghidra behaves differently when loading a raw binary vs when you load an ELF file. Perhaps it was something with the analyzers, I can't recall (there are ELF-specific ones for example).
Re:Reverse engineering the Motorola Sensorhub: Part 1 by bobby_bobby on Monday July 05, 2021 @06:18AM (#27736299)
I miss the double-chop torch action sooooo much since moving away from my moto.
Re:Reverse engineering the Motorola Sensorhub: Part 1 by bjoli on Wednesday July 07, 2021 @07:25AM (#27759786)
I use it multiple times every day. My old Moto is dying and I am dreading the day I buy a new phone.