| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On May 2, 2005, at 7:23 AM, John Dalgliesh wrote:
Speaking for the system, I don't want anything doing work as root that does not *need* to run as root. A firmware uploader for a device driver does not need to run as root if the image can be validated. If it is implemented inside the driver, it must run as root. If it is implemented in a daemon/helper application, it can (and ideally should) run as someone other than root. Note that if you run the helper as, e.g. daemon/daemon, it is not possible to become that user without having been privileged at some point. This guards you against uploads by arbitrary users, but does not require that the uploader actually run with privilege. It's a much better way to go about it.
No, I don't, and I can't see how you get there from here. From a trust standpoint, code running in a kext is worse than a daemon running as root, which is worse again than the daemon running as some other user. In this example, the principle of least privilege applies.
Ultimately you are trusting the filesystem; in other words, your protection only extends to the point that you assume that an attacker has never had privilege. In order to trust your uploader, you do not need for it to have privilege, merely to demonstrate that at some point it had it. Speaking for the system, again, I would be much happier to know that a trusted system component with privilege started your uploader in a without-privilege state. Your trust requirements are met with the overall use of least privilege.
On the contrary, again we look to the principle of least privilege. Code goes into the kernel, or runs as root, because it *requires* that privilege. If it doesn't require one or the other, it should not. There's nothing that a straightforward loader does that requires privilege.
The NVRAM module has no ability to examine the semantic impact of the data it's being passed. Thus it requires a straight _expression_ of trust on its caller. Since the interface is used interactively, this maps best to requiring the caller to be root. Conversely, since your firmware image is protected by the filesystem, the uploader is started by a trusted component and obtains a token (a reserved uid/gid) of same, root privilege is not required and thus should not be used.
And the point I have been trying to make all along is that is *not*. I understand that you think that because you have something called "open" and a function out of <vnode_internal.h> that looks like "read" and "write", you have userland-like semantics.
You shouldn't do this; the vnode comes to you ready to use. What led you to believe it needed to be unlocked?
Did you plan on closing it at some point?
It's not really the issue you make it out to be.
You don't have to have someone logged in for a daemon to run as non-root; many of the system daemons run this way.
daemon:daemon would be a good start.
A startup item works just fine. It starts, then waits for the device to show up. When it shows up and the driver attaches, it uploads the firmware to the driver. This involves: 1) No daemon running with privilege 2) No file I/O inside the kernel 3) No route to compromising the firmware image without having privilege 4) Less code within the kernel 5) A simple, modular design = Mike |
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-drivers mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-drivers/email@hidden This email sent to email@hidden
| References: | |
| >Re: Saving persistent data from kernel? (From: Mike Smith <email@hidden>) | |
| >Reading kext resources in the kernel (Was: Saving persistent data from kernel?) (From: John Dalgliesh <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.