Conversation started Nov 26, 2011 at 4:43.
Nov 26, 2011 04:43
I would love to learn French but I never though it would be a IT Sec prerequisite.
@thisjosh I'd love to get better at French. When I meet real genuine french people I realise exactly how much I don't know.
@Ninefingers Unfortunately my ignorance is a broad spectrum of topics.
@thisjosh Mine too, unfortunately. The more I learn things the more I realise that there's just so much I cannot possibly get around to learning.
Pretty sure there's a famous quote in there somewhere, but it's 5am here - couldn't stay asleep
It's only evening here. I believe the quote is along the lines of 'The more I learn, the less I know'
a certain IT Sec contribuiter seems to have a penchant for picking at some of my weak areas of knowlege, so I must review the L4 kernel API, which I though I understood
Nov 26, 2011 04:59
@thisjosh You do. See my answer.
You're quite right, assuming the reference is to be believed.
Although I've not seen or had the pleasure to use it, IPC would have to be implemented by the core component and that would then check and maintain the integrity of the tokens.
More detail than that, particularly with x86 I can't imagine how it's done.
I'd love to see it though.
Oh thanks. Nice answer.
No problem; I only posted a separate answer because I felt the need to refute a few things and clear up some definitions.
Oh for x86 you don't need atomic actions if the OS guarantees that the sequence of operations will be atomic
In my mind it's a hazy subject anyway - is an extended attribute labelling a directory a capability? I'm not sure, but it sure sounds like one...
Mmm good question.
File system protection, It would be a more indirect effect of capabilities
Nov 26, 2011 05:06
@thisjosh I' more wondering where you'd store the tokens so as to be part of the process's address space and yet unmodifiable by it. I'm not entirely sure about setting ring 0 pages in the user's virtual memory.
ohh you mean hardware support for better virtual memory protection
well, that token needs to be protected because that's your reference the OS will use to look up the access you're allowed, so you can't let the process modify it.
Actually - simple - read only pages.
Duh.
Hardware support would be really interesting.
I think most ARM MMUs offer more description bits for memory pages
althought x86-64 says it supports no-execute for pages
@thisjosh Probably; x86_64/i386 both do in varying ways. You can ignore the write protection features using the cr0 control register which is how you can load a kernel module in and redirect the read only system call table on current kernels.
ohh weak implementation
Nov 26, 2011 05:12
If you move the write protection bit you get to write everywhere :) but a standard process (ring 3) cannot do this to itself.
does the loader pick it up or does it get to the actual address translation?
straight assembly with no libraries to load?
@thisjosh basically you achieve it like this memset.wordpress.com/2011/01/20/…
As I understand it kernel modules are ELF binaries, but linked against kernel addresses rather than something in userspace, so no libraries. So when your init function executes, you're in ring 0. Turn off cr0 write protection, alter the system table and turn it back on again. Tada, you hook a system call.
That kind of modification (control register modification) isn't allowed in ring 3, you see, so if your compiled code tries to do it it'll be rejected.
The hard bit in the above blog is twofold; you've got to find the address of the table from the symbols file (system.map) and that changes per kernel build - you can't hard code the address in any more.
Ok, just took a look.
I never looked to see what kernel modules were, but I can believe they are ELF.
I think Linux does use the no-execute bit on Intel architectures where available. Though that certainly doesn't solve the write vulnerability.
Nov 26, 2011 05:28
@thisjosh I've not looked but I reckon if we did we'd find it does, especially on x64. The write issue you can't do much about - the kernel is monolithic (all ring 0) by nature, so the only defence comes in ensuring bad stuff does not get loaded in as a kernel module.
But for L4 you are worried that a program could modify capability tokens in read-only memory?
because the kernel can modify the memory if it wants to
@thisjosh I was, but in L4, drivers don't get into that all important ring 0 core component
I was more wondering how you'd do it on x86, completely forgetting the obvious :)
True, in L4 almost everything is done at the program/application level even scheduling!
There are plent of opportunites to do bad things without breaching ring 0 although not with memory tricks
I don't know how L4 manages contention for hardware interrupts.
First come first serve, sorry I got your interrupt before you. Fair-scheduling, at least I get some of your interrupts.
It would be fascinating to know - I take it I'm right in saying L4 is closed source?
Thats a good question, the answer is sort of.
It has academic heritage and several branches. It started as pure assembly because Mach was too slow in high level languages.
It is relevent today because of it acceptance in mobile devices and its formal verification for defence articles.
It splintered a little when one group rewrote L4 in C/C++
Nov 26, 2011 05:45
I love that one of the derivatives is called fiasco. "So, your code is super secure, yes?" "Yep!" "What's it called?" "ummm..."
I believe thats the x86 port
The next project I write is going to be called "buggy"
And the one after that "over budget"
A lot of recent work was done at University of New South Wales in Australia which spun off the technology to a company called the Open Kernel Group
'under budget' would be funnier
So some version of L4 are available in source, but the ones used comercially are only typically only available in binary form. Although much of the closed source evolved from known open source.
@thisjosh That's interesting to know. I'm going to grab fiasco and have a look at some point - it'll be an education.
L4Ka::Pistachio is the closes to commercial as it is the last open research source in the evolution to the closed source
Nov 26, 2011 05:55
@thisjosh Hmmm their website is down. I'll keep an eye out for it too
but fiasco would be interesting to look at especiall along side Linux kernel of the same vintage
a lot of good free papers for L4 on CiteSeer citeseer.ist.psu.edu/…
@Ninefingers Thanks Ninefingers! I feel better that I didn't completely misunderstand capabilites.
@thisjosh No problem. I think the exception might be to the phrase "explicitly defined" which in a way they are at some point and then communicated out.
It sorta sounds like the Android permission model if you like. I think if you read it fast that might be how it comes across but that isn't what I thought you meant.
That doesn't sound any clearer reading it back, but pah, I know what I mean.
Nov 26, 2011 06:15
I know you know what you mean.
 
Conversation ended Nov 26, 2011 at 6:15.