yashsingh1/xdaforums huggingface dataset:
[OnePlus 3 & 3T Cross Device Development] UsPdSr:
Without being to much of an kiss ass, I agree with your position regarding the bug tracker.

This ist not only a Android isssue alone.Linux in General is affected.

Just a couple of days ago, Kali Linux as well as Debian were massively damaged by a bug which has been reported almost 3 years ago.

I dislike Windows (kindly put), but at least the system is stable.

PS

Don't geht me wrong.

Telemetrie and dozen of other factors make Windows 10 the worst distribution in the companies history.

I look forward to the day they shut down this monstrosity.

Maybe they could stop by Apple. ;x

edit.//

I try Oxygen Pie at the moment.Excuse the grammatic.

Gboard and so
[OnePlus 3 & 3T Cross Device Development] anupritaisno1:
I really lost much interest in prebuilt distributions

I'm always either running arch or Gentoo (Gentoo not so much because resolving dependencies while upgrading the system is a pain)

Ironically I've tried Debian once on my server and it gave me so much downtime I doubted it's claimed "stability". In fact I've switched to arch which everyone says is a bad idea for stability and the glassrom server has never been down since then

I also build the Linux kernel myself https://github.com/anupritaisno1/linux-hardened

Some stupid vulnerability making headlines in the news? I think I already had the patches merged a week in advance

As for Windows:

"If you don't pay for something you are the product"

I did try windows server editions and they had none of these issues. Why you ask? Because these editions sell for almost $3000-4000 and we aren't even talking about support fees and other stuff paid by individuals who buy these.

Windows consumer editions are terrible
[OnePlus 3 & 3T Cross Device Development] anupritaisno1:
Okay guys I made a test build

The next build will have a few huge changes and a few bugs might be missed during beta testing so here is the testing zip: https://glassrom.pw/signed-ota_update.zip

Changes: f2fs and ext4 are now unified

Kernel has been updated to the may 5 security patch

PAN emulation has been causing undefined behaviour on locked bootloaders and has been temporarily disabled

A few more things need to be done for the next release so this isn't a release build. Here's what needs to be done:

Use the unification approach on sdfat and vfat to make flashing custom kernels easier

May 5 security patch needs to be merged in the ROM

Dm-verity might have a few issues with this build

No new bugs were discovered during beta testing but I'd like some feedback
[OnePlus 3 & 3T Cross Device Development] anupritaisno1:
This is a testing build. If you have flashed it I'd like to know how things are going. Please reply with how it works if you use it
[OnePlus 3 & 3T Cross Device Development] anupritaisno1:
This is in response to whatever mess WhatsApp has been up to this week

CVE-2019-3568

First I'm going to give some serious analysis

Facebook details the vulnerability as "a buffer overflow in WhatsApp's VoIP stack"

First let us understand what a buffer overflow really is

Many programming languages require you to allocate memory before you use it. Imagine a simple program that copies the user's name from an input device like the keyboard

We'd allocate memory like this (C89):

char name[3];
int a;

Let's say I allocate 3 bytes for the character array name (the [] makes it an array and the 3 tells the compiler how many bytes to reserve)

int a defines an integer a. It just stores some number. The value stored isn't exactly important

Let us say the program takes in a name

> a

Executes fine

> ab

Executes fine

> abc (note that char * is unsigned)

Executes fine

Where does the mess hit the fan?

> abcd

Here's where the weird part starts

Let us denote the memory allocated in char as * and the memory allocated in our integer a be denoted by £

Assuming a 16-bit compiler we assume int a to be 2 bytes with one of the bytes containing the sign (positive or negative)

When we use 4 something interesting happens

***££
...^

The 3 dots are the first 3 letters "abc" in the character array

Notice that the 4th bit is overflowing into the adjacent memory that had been allocated for a by the compiler

This is a theoretical overflow or stack smashing attack. The language itself assumes that the code is correct and does not account that the character array can overflow beyond 3 bytes. The overflow invades the memory allocated for other variables and changes their value

Here we merely overwrote the value stored in the integer a. However this kind of a method can be used to maliciously inject code into the memory of a running program and take control over it

So.... is this preventable?

Most certainly yes. This is an attack that has been known for almost 2 decades now and most compilers have very good mitigations against these

So why is WhatsApp vulnerable?

Glassrom does not know. An attack that shouldn't have been possible due to advances in compilers suddenly happens. Do you seriously think we have an explanation? We don't

How does glassrom protect against the vulnerability?

This is completely a userspace exploit. Glassrom protects against this by selinux hardening. Yama prevents WhatsApp from infecting other apps. In other words on glassrom WhatsApp cannot easily spread the infection to other apps however WhatsApp itself might be compromised

How do I protect myself?

Update WhatsApp immediately

Also do note. WhatsApp is proprietary. Proprietary software doesn't respect your freedoms. Here's a neat article by telegram on why you should not use WhatsApp after what just happened

https://telegra.ph/Why-WhatsApp-Will-Never-Be-Secure-05-15
[OnePlus 3 & 3T Cross Device Development] anupritaisno1:
Updated:

Linux 3.18.140

Merged latest CAF tag and WiFi driver (LA.UM.7.5.r1-04800-8x96.0 or LA.UM.7.6.r1-04800-89xx.0)

F2FS upstreamed to 5.2-rc1-3.18

Port of hardened Linux patchset

FORTIFY_SOURCE=1 is now enabled for the kernel

Kernel compiled with -fstack-protector-all to protect against buffer overflow vulnerabilities

All current networking updates from lineageos common kernel

May 5 2019 security patch

Ext4 and f2fs are unified. There is no need to flash separate variants

Wireguard has been removed

Improvements to gaming performance

Verifying builds: https://github.com/GlassROM/glassrom-verification/commit/9f107fc14a1d6703c9f1adc7ade464befb047561

Note that if you use enhanced TWRP you must update glassrom before you update the TWRP. The flash order matters
[OnePlus 3 & 3T Cross Device Development] anupritaisno1:
With this release a new GCC 8 compiler has been added. The cross compiler can be found here https://bitbucket.org/anupritaisno1/aarch64-linux-gnu
[OnePlus 3 & 3T Cross Device Development] cacio_confusa:
reason for removing wireguard?
[OnePlus 3 & 3T Cross Device Development] anupritaisno1:
It caused a lot of inconsistencies during testing. The only officially supported method to add wireguard updates wireguard whenever it wants and this introduces too many inconsistencies in testing builds

In a future build MODULES and MODULE_SIG_FORCE will be enabled and wireguard can be loaded as a kernel module. Sadly there was no time to test this for this release cycle

Tl;dr wireguard is affecting build reproducibility which is important for open source projects
[OnePlus 3 & 3T Cross Device Development] :
Hope you can give me some clearity, although explanation in first post seems very detailed, but still have some questions. So, hope you are willing to help... ?

My phone is decrypted now, using your twrp and Los16. I am using a bash script to remove some apps (/system/apps and /system/priv-app) from rom because of using other apps.

Is it possible to do this keeping dm-verity, so doing an normal install and update by installing your rom, then your twrp, running my bash script from twrp terminal and booting normally?

This would be great, using encryption, your stealth rom and my own setup.

As I understand, update would then be updating your rom only and running my script again afterwards?
[OnePlus 3 & 3T Cross Device Development] kevinsnijder:
I somehow cannot manage to install this with opengapps.

I've tried everything but I always get a DM verity message and then a blackscreen.

Without opengapps the ROM works fine, though...
[OnePlus 3 & 3T Cross Device Development] anupritaisno1:
You'll have to use a dm-verity disabler to flash gapps

The black screen occurs because mounting system fails because it is modified while verity is enforcing. Init dies as /system cannot be mounted and kernel dies with the message "Kernel panic - not syncing: Attempted to kill init!"
[OnePlus 3 & 3T Cross Device Development] anupritaisno1:
Dm-verity does not allow any modification of the system partition while it is enforcing. It needs to be disabled to be able to boot after modifying the system partition

I'd like to look at this batch script btw

Edit: yes you can flash the ROM and run your script. The ROM installer only installs the ROM. There is no backuptool or anything else that runs so flashing the ROM always gives a clean system partition
[OnePlus 3 & 3T Cross Device Development] anupritaisno1:
I can't see why the script won't work

A few things to take care of though:

Glassrom is a user build so some of your props (like the checkjni) are already set to that value

fstrim is not required. Glassrom mounts all partitions with discard just like the pixel 3 does. Further if you use f2fs a discard is run every time you shut down the phone (upstream F2FS behaviour)

Glassrom does not use the cache partition at all. There is nothing to delete there

Clearing dalvik-cache is a very bad idea. First, glassrom has better garbage collection so clearing the cache is not necessary. Second, glassrom does not use JIT but instead uses AOT and slowly compiles JIT over time. Clearing dalvik-cache on a running system will likely crash everything

There is also no evidence that clearing caches improves anything. Most of it is word of mouth. In fact there is a lot of evidence that clearing cache harms battery life and performance instead of improving it

Also note that AOT can cause glassrom to write anywhere from 8-16 GB to the storage if you clear the cache
[OnePlus 3 & 3T Cross Device Development] :
Thanks for your quick and complete answers.

It would be great to have a rom where I do not have to change JIT settings and some other things.

In my opinion using AOT is much better then JIT, most other things are already set by Glassrom itself..., no fstrim needed, I can forget my dalvik; sounds great!

To finish this discussion, so I can install your rom (encryption is done by the rom), install your twrp, run my script without build.prop part, clearing caches and fstrim and that would be it.

When this is a yes, I will definitely give it a go!
[OnePlus 3 & 3T Cross Device Development] anupritaisno1:
JIT is profile guided so has better inlining support. PGO also makes JIT adaptive to the code

Think of it like this: AOT is something that always evaluates to a constant. JIT keeps observing the actual run of the program and bases it's optimisation details on the actual execution rather than a heuristic. JIT's adaptability puts it at an advantage to AOT

In my testing a fully optimised JIT should be 1.63 times faster than AOT. This is why glassrom does JIT even if AOT is precomputed
[OnePlus 3 & 3T Cross Device Development] cacio_confusa:
so i also have made a script which debloats my custom roms and survives OTAs. (addon.d script) but it does not work when i try to apply it on glass rom :confused:
[OnePlus 3 & 3T Cross Device Development] anupritaisno1:
Glassrom does not run backuptool after an update. You'll have to manually flash everything after you install the ROM
[OnePlus 3 & 3T Cross Device Development] cacio_confusa:
ok, but it would not explain why it does not delete it even if flashed manually. i trigger the script while flashing.

update-binary:

#!/sbin/sh
ZIP=$3
mount /system
mount -o rw,remount /system
mount -o rw,remount /system /system
cd /tmp
unzip -o "$ZIP"
cp -r /tmp/system/* /system
chmod -r 0755 /tmp/system/addon.d
sh /tmp/system/addon.d/33-debloater.sh restore

the debloater script:

#!/sbin/sh

do_remove() {
if [ -e "$1" ]; then
rm -rf "$1"
fi
}

remove() {
do_remove "/system/app/$1"
do_remove "/system/priv-app/$1"
}

case "$1" in
backup)
# Stub
;;
restore)
remove AudioFX
remove BasicDreams
remove BookmarkProvider
remove Calendar
remove Contacts
remove DeskClock
remove Eleven
remove Email
remove ExactCalculator
remove Jelly
remove Gallery2
remove Recorder
remove Snap
remove Stk
rm -rf /system/media/bootanimation.zip
;;
pre-backup)
# Stub
;;
post-backup)
# Stub
;;
pre-restore)
# Stub
;;
post-restore)
# Stub
;;
esac

so far it has always worked for me. this is the first time on a custom rom that it does not work :/
[OnePlus 3 & 3T Cross Device Development] anupritaisno1:
Edit: sorry I think I messed up the scripts. Just give me a moment
[OnePlus 3 & 3T Cross Device Development] cacio_confusa:
if you would allow to disable every app inside of android, i would not need the script. for now i have disabled the apps with adb. so far the rom seems running good, but can you please look up to paranoin android 7 regarding touch panel latency improvement ? also if you are already looking there, take a look at the config of the interactive governor. the devs said that its one of the bigger reasons why aospa7 was so incredibly fluid. they fine tuned it well. thank you very much :)

https://github.com/AOSPA/android_kernel_oneplus_msm8996/tree/nougat-mr2/drivers/input/touchscreen

https://github.com/AOSPA/android_kernel_oneplus_msm8996/tree/nougat-mr2/drivers/cpufreq

EDIT:

well, it does not run well. the CPU gets always utilized when screen is on. at least one core gets utilized 100% all the time (except when screen is of, then its sleeps)

what can it be ? i noticed that when installing apps, it does take really long (my guess would be be your optimized JIT compiler)

encryption should be anyway hardware accelerated.

i have also not even loaded the phone with all my usual apps, only using the bare minimum right now.

something is running in the background when screen is on. CPU usage never drops under 50% even if no app has been started after a reboot. the phone also gets really hot after a while with screen on (obviously because of the CPU)

geekbench also shows really bad multicore score (and my phone has already upgraded thermal pads which improves the performance)
[OnePlus 3 & 3T Cross Device Development] cacio_confusa:
so i rebooted. started only the kernel adiutor and gsam battery monitor apps and let the screen on for 20min (caffeine tidle)

this are the results. its sadly a massive bug. for now i have to switch to other rom until its fixed :(
[OnePlus 3 & 3T Cross Device Development] anupritaisno1:
On glassrom a bug gets triggered where magiskd randomly starts using 100% of any one CPU core

This is not something I can fix. Similar issues have been reported on the oneplus 5 and the Poco f1. The only solution is to uninstall magisk or try different versions until you find one that works

Further, newer versions of magisk attach debuggers to zygote. Glassrom's kernel forbids this system call as it is dangerous and magiskhide breaks

Edit: you can modify the interactive governor yourself. Not everyone wants these changes
[OnePlus 3 & 3T Cross Device Development] cacio_confusa:
yeah i am on your side.

uninstalled magisk, the massive CPU utilization stopped. but now i have to get my head around making the mods i've used, flasheble to system. mainly enabling to use the earphone speaker as main speaker (aka dual mono / fake stereo) because something is broken on my mainboard so the main speaker does not work (tested the speaker itself, its working. its the audio ic )

and viperfx..

i could try older versions of magisk first, but i've updated to the very new one (which was released today) and the bug was still there.

anyway, thanks for clearing this up
[OnePlus 3 & 3T Cross Device Development] skymera:
Have you run top to find out which process is actually using all that CPU?

Run top from adb shell as root and sort by CPU. Post here if needed.
[OnePlus 3 & 3T Cross Device Development] anupritaisno1:
I've already done that

Magiskd is on the top. There are several reports that magiskd uses 1 CPU core 100% and holds a very large wakelock on several devices

Sadly most of my testers haven't triggered the bug yet but the bug itself exists and I have no idea what's causing it
[OnePlus 3 & 3T Cross Device Development] skymera:
Strange, I thought the 100% CPU bug was only affected Magisk 19.0
[OnePlus 3 & 3T Cross Device Development] :
Your website glassrom.pw seems out of order?
[OnePlus 3 & 3T Cross Device Development] anupritaisno1:
Yeah I was on vacation just trying to patch the zombieload vulnerability on the server remotely and I messed up

We're looking at more than 12 hours of downtime

It's finally back up and everything is working so there should be no more issues.

This isn't the first time glassrom has had downtime. You could say we are famous for messing up like this at times

We are trying to improve on this front. We've gone from one downtime every other day back in 2017 to one downtime every 6-8 months. It's not really good but it's the only thing that can be done about it
[OnePlus 3 & 3T Cross Device Development] :
Will your kernel pass safetynet with unlocked bootloader?

You say your kernel does not have any tweaking, so also no safetynet patch? Would be nice if patch is included, also because Magisk is not needed then and bootloader can be kept unlocked.
[OnePlus 3 & 3T Cross Device Development] anupritaisno1:
​

Glassrom itself does not ship gapps but you can try it yourself and let me know if it works. It never hurts to try
[OnePlus 3 & 3T Cross Device Development] :
It was not ment for Gapps but for banking. I am happy with NOT using any Gservices... ;) But one of my banking apps is not working without Magisk on LOS, known issue with LOS, probably because of missing kernel patch?

https://amp.reddit.com/r/oneplus/comments/8a9m34/fyi_you_can_still_pass_safetynet_on_custom_roms/
[OnePlus 3 & 3T Cross Device Development] cacio_confusa:
is it possible to add support for F2FS storage in glassrom? i have an external usb ssd with F2FS, and want be able to use it on my phone from time to time. thanks
[OnePlus 3 & 3T Cross Device Development] anupritaisno1:
I think vold only allows mounting of exfat volumes. The only way I can think of to get f2fs is to treat the ssd as an adopted storage device. If you want to message me on telegram/discord we can figure this part out
[OnePlus 3 & 3T Cross Device Development] cacio_confusa:
sure, pm me with your telegram nick
[OnePlus 3 & 3T Cross Device Development] anupritaisno1:
https://t.me/clannad
[OnePlus 3 & 3T Cross Device Development] anupritaisno1:
You can use P firmware. I couldn't find any significant changes in P firmware
[OnePlus 3 & 3T Cross Device Development] anupritaisno1:
Glassrom is currently down due to the aftereffects of a massive outage. I don't know how long it has been since it went down but the server should be back in a few hours
[OnePlus 3 & 3T Cross Device Development] sandeep_kumar:
After reading OP, I am confused. Please let me know the following:

For the first time flashing, does it take 50 minutes!!!!

Are the steps of flashing as:

1) Flash ROM,

2) Gapps

3) Magisk if wanted
[OnePlus 3 & 3T Cross Device Development] knpk13:
The order of steps is right, I didn't try gapps or magisk with this ROM though. And no, when I tried it, first boot did not take 50 minutes. More like 5 minutes.
[OnePlus 3 & 3T Cross Device Development] sandeep_kumar:
If you did not try Gapps then Is it microG ready or Gapps included?
[OnePlus 3 & 3T Cross Device Development] knpk13:
Read OP. It mentions that gapps aren't included and microg is supported. And I only wanted to try out the ROM, not use it. I use NLOS as my daily driver. Keep in mind this ROM forces encryption if you're new to it.
[OnePlus 3 & 3T Cross Device Development] anupritaisno1:
Actually op3 is a weird case. If you look at the lineage charter devices that have forced encryption on the stock ROM should but are not mandated to force encryption

I do not exactly know why lineage made the decision to not force it because they do so on every oneplus device after the oneplus 3t anyway

However it's a lot easier to disable it on glassrom than on oxygenos
[OnePlus 3 & 3T Cross Device Development] Sytis:
I'm really digging your approach of building an aftermarket firmware, tried it and really liked it so far. I know Magisk is not supported and 19.3 has supposedly fixed the 100% CPU bug, but I'm having quite some struggle getting any module working probably because of YAMA (some ptrace permission denied errors in the log). The reason I like to use Magisk is just to use my very few modules like microg while still maintaining dm-verity. Is there a known working Magisk version for the current release or another way to use microg without tripping dm-verity? Other than that, really like the ROM and had no issues with re-encryption and F2FS or anything else whatsoever. :)

EDIT: I could get most of microg working because of the implemented patches. But still got that ptrace "issue".

EDIT2: Got rid of Magisk now as I could get the same functionality I needed without, just took more work. No Problems anymore. :good:
[OnePlus 3 & 3T Cross Device Development] anupritaisno1:
Sorry guys there are a few problems at glassrom

So what happened? Well recently we upgraded our compiler to gcc 9 and that switch caused many crashes and issues on the server. The next glassrom release will be slightly delayed until this issue is fixed. For now the server is so unstable that attempting to build the ROM on it will crash it. This is what the random downtime this week was
[OnePlus 3 & 3T Cross Device Development] anupritaisno1:
Most microg apps can be installed as user apps. The only exception will be Google play store which will need a permissions.xml in /system/etc/permissions and the app itself in /system/priv-app

Glassrom allows location providers to be user apps

As for yama I can certainly make a build that disables it
[OnePlus 3 & 3T Cross Device Development] Sytis:
Thanks, I figured most of that out myself now. But don't bother removing Yama for now, as I don't need Magisk that much. Actually Yama only seems to break MagiskHide as it works with ptrace which is protected by Yama. Maybe add it to the list of things to consider but don't give it a high priority. I myself haven't bothered with GCC 9 yet because I heard about some breakages elsewhere as well and stayed on 8.3.0 for my personal systems. So good luck with that.
[OnePlus 3 & 3T Cross Device Development] anupritaisno1:
Glassrom is shutting down the discord server

This is the second time one of glassrom's board members have been banned by discord for absolutely no reason

An alternative is being discussed. All current discord members are asked to move to telegram. Anyone who's not already on the discord server will just have to wait until the mess has been cleared up and the glassrom team comes up with a viable alternative
[OnePlus 3 & 3T Cross Device Development] anupritaisno1:
It seems the recent trouble with verizon caused even more problems at glassrom's parent company so yeah more time was spent in fixing those issues instead of building

On the positive side all of glassrom's infrastructure is now amd64. Thanks to Ubuntu's decisions all 32-bit files have been removed from the servers

I don't run Ubuntu. I run arch but the Ubuntu decision to drop x86_32 did make removing multilib a lot easier
[OnePlus 3 & 3T Cross Device Development] Sytis:
Luckily my servers weren't affected, but a lot of my friends using Cloudflare CDN had major downtimes as well. My servers run Gentoo for compiling as it makes managing sources easier for me. But Arch (or my preference Parabola) is a solid alternative because of easy deployment. When switching hardware in a few weeks, I might also rebuild everything with GCC 9, let's see.
[OnePlus 3 & 3T Cross Device Development] anupritaisno1:
I'm nearly done with the June security patch release. It should be out in a few hours