Ok.. my kernel is (I think) a hybrid.. I don't really care to follow any one pattern for monolithic or micro... I will follow what looks and works the best at the time.
So I am stuck though. How do I manage logins in my kernel? is the kernel even the appropriate place to do it?
My current idea is very fuzzy in my opinion. This is it:
have a securelevel variable. When it is of appropriate value, then processes can not be spawned without a valid login ID. And there would be a syscall for obtaining a login ID through a user and password combination.
My problem with this: how would I manage sudo? (su seems simple enough with this)
How have you guys done it and other kernels? cause I really have no idea if logins should be a hybrid of userspace and kernel, or just kernel(for security), or just userland(for flexibility) and which would be easiest.
How to "login"
- Troy Martin
- Member
- Posts: 1686
- Joined: Fri Apr 18, 2008 4:40 pm
- Location: Langley, Vancouver, BC, Canada
- Contact:
Re: How to "login"
Take a peek at how linux/BSD do it. That's what I'm doing to figure out a simple login system (doing it in rmode assembly takes more time though...)
Well, one easy way is to set the login ID to whatever root's ID is, then have the program return to the middle of the sudo program no matter what (might need to modify some ISRs here) so that you can't take advantage of being root, even though you could just sudo bash or whatever your shell is.how would I manage sudo? (su seems simple enough with this)
- Colonel Kernel
- Member
- Posts: 1437
- Joined: Tue Oct 17, 2006 6:06 pm
- Location: Vancouver, BC, Canada
- Contact:
Re: How to "login"
I can briefly describe how NT does it, based on only publicly-available info of course. Every kernel resource (mutex, file, thread, process, device, etc.) is represented by an object that can be protected by an ACL (access control list). However, the actual principals (users and groups) referred to by those ACLs are managed in user space by LSASS.exe (Local Security Access Sub-System), which manages the users/groups and passwords stored in the Registry. Yet another user-space server (Winlogon.exe) handles actual logons and communicates with LSASS. Winlogon is the root of the tree of processes for a logon session. All these sub-systems communicate via IPC amongst themselves and with the kernel.
Obviously *nix concepts like su don't really exist in the NT world, but hopefully this helps anyway...
Obviously *nix concepts like su don't really exist in the NT world, but hopefully this helps anyway...
Top three reasons why my OS project died:
- Too much overtime at work
- Got married
- My brain got stuck in an infinite loop while trying to design the memory manager