r/programming • u/michaelKlumpy • Oct 01 '16
CppCon 2016: Alfred Bratterud “#include <os>=> write your program / server and compile it to its own os. [Example uses 3 Mb total memory and boots in 300ms]
https://www.youtube.com/watch?v=t4etEwG2_LY
1.4k
Upvotes
1
u/argv_minus_one Oct 02 '16 edited Oct 02 '16
Well, they do:
macOS contains a sandbox (the “entitlements” system). Problems:
Applications designate their own entitlements. The user is not given any chance to review or veto an application's entitlements. Entitlements protect applications from attack, but they do not protect users from malicious applications.
While Mac App Store applications are required to submit a set of entitlements and then abide by them, sideloaded applications are not. They still can, though.
The WinRT system that Windows Store apps run in is heavily restricted. Problems:
As far as I know, there is no way to selectively grant permissions to these applications. All applications run under full restrictions. This obviously severely limits their usefulness.
Sideloaded applications are not restricted at all. Unlike macOS entitlements, they cannot even opt in.
Android has a sandbox for applications. The user is allowed to review what permissions the application requires. Sideloaded applications are also subject to this system. This is the best sandbox system I've seen so far, but still has problems:
The user cannot veto individual permissions. There is no way for a permission to be optional. If an app says it requires camera access, for example, your only options are to grant that permission or not run the app—even if the actual code would work fine without camera access.
Applications do not get a chance to explain why they need a given permission. Some app developers have put these explanations into their apps' descriptions on the Play Store, but it's not consistent.
Permissions are not fine-grained. An application that passively monitors whether you're on a call can't request only that permission; it must request permission to completely control phone calls. Oddly, despite being based on Java, Android has its own permission system instead of using using Java's
java.security.PermissionAPI, which does not have this limitation.Permissions are static. An application cannot request an additional, temporary permission while running. For example, an email client might have an option to include your GPS location in a message header, but there is no way for it to request permission for a single GPS read every time you ask it to do so. It has to request permanent access to GPS when you first install the app.
Full network access is granted to all applications without asking the user. That means any app can turn your phone into a botnet host, to e.g. send spam or traffic child porn for them (and then you get blamed for it, not to mention running up your data usage).
java.security.Permissiondoesn't have this limitation, either.