Re: [patch 00/13] devtmpfs patches

From: Kay Sievers
Date: Tue May 12 2009 - 11:54:58 EST


On Tue, May 12, 2009 at 17:35, Stephen Smalley <sds@xxxxxxxxxxxxx> wrote:

> I think the issue is that the devtmpfs functions are calling vfs helpers
> to create and unlink the device nodes, and those helpers apply
> permission checks based on the current process' credentials. ÂI think a
> similar issue arose in sysfs a while ago. ÂOptions are to either bypass
> the vfs helpers to avoid that permission checking for what I think are
> intended to be kernel-internal operations, or to override credentials
> temporarily around the calls to the vfs helpers, ala:
> new_cred = prepare_kernel_cred(NULL);
> old_cred Â= override_creds(new_cred);
> rc = vfs_mknod(...);
> revert_creds(old_cred);

Ah, I see. That's probably what stuff like this is for:

/**
* lookup_one_noperm - bad hack for sysfs
* @name: pathname component to lookup
* @base: base directory to lookup from
*
* This is a variant of lookup_one_len that doesn't perform any permission
* checks. It's a horrible hack to work around the braindead sysfs
* architecture and should not be used anywhere else.
*
* DON'T USE THIS FUNCTION EVER, thanks.
*/
struct dentry *lookup_one_noperm(const char *name, struct dentry *base)

Thanks,
Kay
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/