[OnePlus 7 Pro ROMs, Kernels, Recoveries, & Other D] anupritaisno1:
It's been a while since I wrote a technical article on something so really, here goes

Tl;dr of this post is all the research the glassrom team was able to do the last few months, the new features that are expected, many of which will appear in the new version and the current status of funding and developers working on the project along with detailing a common mistake app developers often do, in reverse order

First of all, let us get into details about a mistake app developers do when dealing with alarms on android that I've seen people do on custom ROMs

Refer to this article: https://developer.android.com/reference/android/os/SystemClock

More specifically this part:

"Three different clocks are available, and they should not be confused"

It seems a lot of developers aren't handling this correctly. Let's look at the first one, which says:

System.currentTimeMillis() is the standard "wall" clock (time and date) expressing milliseconds since the epoch

What this clock does should be quite straightforward? Well, no. Let's look at a real bug:

A developer wrote a feature that turned off a certain additional feature on a device after a period of time if it wasn't in active use as the feature inherently added attack surface

Their mistake? They used this function to get the system time and used the time returned from this to schedule an alarm that turns off the extra hardware feature. Now, if a user has time skew on their device or just the wrong date set, their code set the alarm to a date that would never be reached by the system. So the feature stayed on indefinitely and this is a real security bug. Not acceptable for a security feature. Yet, this exact feature was approved by several experienced programmers who've been working on that codebase for years and nobody ever spotted this mistake.

I feel uptimeMillis() users are sane enough to not make a mistake when using it. Still, this function does not account for time spent in sleep so keep that in mind when writing apps

elapsedRealtime() includes the time since system boot, including sleep time. The user cannot mess with this time as this clock doesn't care about the real world time. Time skew is irrelevant. 2 minutes after boot for instance will always mean 2 minutes after boot, nothing else

For a security feature, use elapsedRealtime() and nothing else

You might have seen the permissions for network and sensors in glassrom. What you probably don't know if you're an app developer is that you can programmatically request these permissions from the user and you can give explanations on why your application needs sensor or network access just like you'd do for any other dangerous permission

Now as for funding, the glassrom project currently isn't receiving any funding. Glassrom parted ways with the past sponsor and we lost much of the funding/devs we had (we still have one board member other than myself but they are in no position to run the project or even fund its operation). I've been personally funding the project with whatever I have every month for now and it isn't enough to hire more developers. Glassrom's infrastructure is currently being run and managed by grapheneos so we do have a proper server for distribution and the like

I guess the most interesting feature would be the one where we allow google apps to be installed without needing them to be installed in the system as privileged apps. This is far more secure than microg and it also doesn't rely on any hacks like signature spoofing as only the official applications can be used with the feature. This will also mean that glassrom doesn't have to make a second build with gapps for users and users who don't want them have the option to never install them at all. This feature was written by kdrag0n for grapheneos

The next feature we have was written by me, it allows you to set a timer after which the device will automatically reboot. The reason this feature exists is so that the device can go in a BFU state and the decryption key would no longer be present in system memory. This allows glassrom to resist forensic based attacks after the device has entered a BFU state

Wifi and bluetooth too can be similarly tired off with a timer. The greentooth app hasn't been maintained for a while and isn't usable anymore so we'll be dropping that. Aurora services and the fdroid privileged extension too are unnecessarily with the new changes in android 12 and they'll be similarly dropped

The last part is about the research glassrom has done (and an apology as it's much needed)

Glassrom started back when I just wanted a proper kernel for my OnePlus 2 as their stock kernel just wasn't great so I decided to tinker with the kernel and I talked with a lot of "experienced developers". And I thought I was on the right track. I definitely did several things correctly all these years. You can verify that when all ROMs were just trying to fix the vulnerability that was making the news, glassrom was never affected by it at all. But here's the thing: partially due to my reputation and my track record for getting security correct people started trusting everything I said and that's where I feel this went horribly wrong. So here I am today -- to apologise, to talk about what I have researched and to correct the harmful misinformation I accidentally spread.

The first claim was actually made in our community, not by the glassrom moderators or developers themselves but by the other members. Most of our communities had members who made others feel like linux is somehow a better OS and well, glassrom is partly at fault here for not correcting or stopping them. The wrong beliefs were mostly spread due to the common misinformation that linux was more secure, more stable and more private than windows or mac (and truthfully, linux is absolutely none of the above) and due to the fact that glassrom had a room that purely focused on hardening the kernel people got that opinion

We mostly fixed this in our community by trying to identify members who were misinformed and clearing up the confusion

I combine all the available evidence on why linux is insecure

Linux | Madaidan's Insecurities

Google slams Linux kernel, says it needs major security investment

Downstream vendors should allocate more resources to the upstream kernel, suggests Google

www.techradar.com

Unsafe at any clock speed: Linux kernel security needs a rethink

Ars reports from the Linux Security Summit—and finds much work that needs to be done.

arstechnica.com

https://mjg59.dreamwidth.org/38158.html but there's definitely so much more out there. If you've been following glassrom for a while then you should definitely give those articles a read

The second mistake was entirely my fault. I told everyone publicly that glassrom would support a linux phone for security. Back then, I just didn't know that linux phones had far poorer security than their android counterparts and that securing them in a

ny capacity won't even be possible

Please see this

Linux Phones | Madaidan's Insecurities

So tl;dr is:

I'm sorry for misleading users by telling them that linux phones would be more secure or that we'd support them

Thirdly, I told users that I'd be shipping linux-libre eventually for "security". This was the worst thing I could do. When you don't do proprietary firmware loading from the kernel, what you get is essentially hardware that loads really outdated firmware from some fallback path. This means that I would have accidentally created security vulnerabilities just because FOSS

So, I am sorry for promising to my users that I'd ship them an insecure kernel and also for falsely claiming it was secure

Fourth, I spread misinformation that open source software is more secure than proprietary. This is absolutely false. Both of them are merely software development models and have absolutely nothing to do whatsoever when it comes to security. I did this with statements where I related glassrom and security merely due to the open source nature of the project. Now, glassrom certainly is secure but not because it is open source

Lastly, I reinforced beliefs of people who claimed that google/microsoft/intel/whatever had backdoors placed in hardware and software when in reality, I didn't know what a backdoor even looked like in the first place. This however, is completely false. People have been reverse engineering their code for decades and not even a single backdoor was found

So now to remedy this mess glassrom has started fact checking everything that is posted in the channels, along with deleting false information. We no longer will strengthen the wrong beliefs people hold

So people here wanted to hear about my research on windows security and how well it went. Well, the results are quite surprising: we've created security mitigations that managed to proactively mitigate vulnerabilities like printnightmare months before we even knew what printnightmare was and we have security measures ready for people who have the threat model of a malicious admin trying to compromise the system. We plan to release it all on GitHub eventually but you can come for a chat at https://t.me/windowssec_group

Glassrom will be working on windows security as well as the android OS so people who still need to use desktop can take advantage of glassrom's security improvements even on their windows machines. And we've already been able to proactively mitigate several vulnerabilities -- even printnightmare -- before they had the chance to become a problem

Desktop security is far worse than mobile OS security, remember that