OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 5:58 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 38 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: How do I do it: OS almost like a library
PostPosted: Tue May 24, 2016 9:51 am 
Offline
Member
Member

Joined: Sat Mar 01, 2014 2:59 pm
Posts: 1146
obfusc8or wrote:
The downside with a SASOS could be lack of memory protection, unless you use a memory-safe programming language for application software.
Except that there's no way to enforce that a malicious developer uses a memory-safe programming language. ;-)

_________________
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.

Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing


Top
 Profile  
 
 Post subject: Re: How do I do it: OS almost like a library
PostPosted: Tue May 24, 2016 4:49 pm 
Offline
Member
Member
User avatar

Joined: Wed Jan 06, 2010 7:07 pm
Posts: 792
Sure there is. It's a trade-off in flexibility, but it's easily possible.

_________________
[www.abubalay.com]


Top
 Profile  
 
 Post subject: Re: How do I do it: OS almost like a library
PostPosted: Wed May 25, 2016 2:07 am 
Offline
Member
Member

Joined: Sat Mar 01, 2014 2:59 pm
Posts: 1146
Rusky wrote:
Sure there is. It's a trade-off in flexibility, but it's easily possible.
Running everything in an interpreted bytecode (e.g. Java)?

_________________
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.

Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing


Top
 Profile  
 
 Post subject: Re: How do I do it: OS almost like a library
PostPosted: Thu May 26, 2016 4:06 am 
Offline
Member
Member

Joined: Wed Jun 03, 2015 5:03 am
Posts: 397
onlyonemac wrote:
Running everything in an interpreted bytecode (e.g. Java)?

Running everything under wise management. Bytecode and stuff are just some small bits of the picture.

_________________
My previous account (embryo) was accidentally deleted, so I have no chance but to use something new. But may be it was a good lesson about software reliability :)


Top
 Profile  
 
 Post subject: Re: How do I do it: OS almost like a library
PostPosted: Thu May 26, 2016 9:04 am 
Offline
Member
Member

Joined: Sat Mar 01, 2014 2:59 pm
Posts: 1146
embryo2 wrote:
onlyonemac wrote:
Running everything in an interpreted bytecode (e.g. Java)?

Running everything under wise management. Bytecode and stuff are just some small bits of the picture.
Like running heuristic binary code analysis before loading a binary to determine if it is memory-safe?

_________________
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.

Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing


Top
 Profile  
 
 Post subject: Re: How do I do it: OS almost like a library
PostPosted: Thu May 26, 2016 10:20 am 
Offline
Member
Member
User avatar

Joined: Wed Jan 06, 2010 7:07 pm
Posts: 792
The point is, the OS has complete control over which code runs, so if the only format it accepts is something it can verify, it can enforce that everything is written in a memory safe way.

_________________
[www.abubalay.com]


Top
 Profile  
 
 Post subject: Re: How do I do it: OS almost like a library
PostPosted: Thu May 26, 2016 1:51 pm 
Offline
Member
Member

Joined: Sat Mar 01, 2014 2:59 pm
Posts: 1146
Rusky wrote:
The point is, the OS has complete control over which code runs, so if the only format it accepts is something it can verify, it can enforce that everything is written in a memory safe way.
So is your proposed "memory-safe programming language" compiled or interpreted? Because if it's compiled, the OS is going to have a hard time "verifying" that it is memory-safe.

_________________
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.

Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing


Top
 Profile  
 
 Post subject: Re: How do I do it: OS almost like a library
PostPosted: Thu May 26, 2016 2:16 pm 
Offline
Member
Member

Joined: Fri May 01, 2015 2:23 am
Posts: 63
onlyonemac wrote:
Rusky wrote:
The point is, the OS has complete control over which code runs, so if the only format it accepts is something it can verify, it can enforce that everything is written in a memory safe way.
So is your proposed "memory-safe programming language" compiled or interpreted? Because if it's compiled, the OS is going to have a hard time "verifying" that it is memory-safe.

Unless all code is compiled and signed by a trusted party (you), and OS checks code signature before running it.

_________________
Hellbender OS at github.


Top
 Profile  
 
 Post subject: Re: How do I do it: OS almost like a library
PostPosted: Thu May 26, 2016 6:53 pm 
Offline
Member
Member
User avatar

Joined: Wed Jan 06, 2010 7:07 pm
Posts: 792
onlyonemac wrote:
So is your proposed "memory-safe programming language" compiled or interpreted? Because if it's compiled, the OS is going to have a hard time "verifying" that it is memory-safe.
Nope, compiled-vs-interpreted has absolutely nothing to do with it. Compilers and interpreters both control 100% of the code they generate, so if you want to ban certain constructs or enforce run-time checks, they're both equally capable of doing so.

_________________
[www.abubalay.com]


Top
 Profile  
 
 Post subject: Re: How do I do it: OS almost like a library
PostPosted: Fri May 27, 2016 2:14 am 
Offline
Member
Member

Joined: Sat Mar 01, 2014 2:59 pm
Posts: 1146
Rusky wrote:
onlyonemac wrote:
So is your proposed "memory-safe programming language" compiled or interpreted? Because if it's compiled, the OS is going to have a hard time "verifying" that it is memory-safe.
Nope, compiled-vs-interpreted has absolutely nothing to do with it. Compilers and interpreters both control 100% of the code they generate, so if you want to ban certain constructs or enforce run-time checks, they're both equally capable of doing so.
Except that, again, you can't ban what constructs the attacker's compiler generates.

_________________
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.

Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing


Top
 Profile  
 
 Post subject: Re: How do I do it: OS almost like a library
PostPosted: Fri May 27, 2016 4:20 am 
Offline
Member
Member

Joined: Wed Jun 03, 2015 5:03 am
Posts: 397
onlyonemac wrote:
you can't ban what constructs the attacker's compiler generates.

It can generate whatever it wants, but OS's verifier will refuse to accept the bull $hit.

_________________
My previous account (embryo) was accidentally deleted, so I have no chance but to use something new. But may be it was a good lesson about software reliability :)


Top
 Profile  
 
 Post subject: Re: How do I do it: OS almost like a library
PostPosted: Fri May 27, 2016 5:15 am 
Offline
User avatar

Joined: Wed May 22, 2013 12:02 am
Posts: 20
Location: The Netherlands
Another way to achieve it would be to compile during the installation process.


Top
 Profile  
 
 Post subject: Re: How do I do it: OS almost like a library
PostPosted: Fri May 27, 2016 10:40 am 
Offline
Member
Member
User avatar

Joined: Wed Jan 06, 2010 7:07 pm
Posts: 792
onlyonemac wrote:
Except that, again, you can't ban what constructs the attacker's compiler generates.
So don't use the attacker's compiler. Distribute apps in some pre-machine-code form (e.g. source, AST, CFG, bytecode) and run the compiler locally, like alexander suggests. This has the added benefit that you can optimize for the local CPU, re-optimize apps on compiler updates, etc.

_________________
[www.abubalay.com]


Top
 Profile  
 
 Post subject: Re: How do I do it: OS almost like a library
PostPosted: Fri May 27, 2016 11:59 am 
Offline
Member
Member

Joined: Sat Mar 01, 2014 2:59 pm
Posts: 1146
embryo2 wrote:
onlyonemac wrote:
you can't ban what constructs the attacker's compiler generates.

It can generate whatever it wants, but OS's verifier will refuse to accept the bull $hit.
So in other words, running heuristic binary code analysis as I suggested a few posts ago.

_________________
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.

Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing


Top
 Profile  
 
 Post subject: Re: How do I do it: OS almost like a library
PostPosted: Sat May 28, 2016 3:13 am 
Offline
Member
Member

Joined: Wed Jun 03, 2015 5:03 am
Posts: 397
onlyonemac wrote:
So in other words, running heuristic binary code analysis as I suggested a few posts ago.

Depends on the OS. If OS accepts binary code then it can use protection or it can employ the analysis. If OS doesn't accept binary then there are more options.

_________________
My previous account (embryo) was accidentally deleted, so I have no chance but to use something new. But may be it was a good lesson about software reliability :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 38 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 28 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group