lkml.org 
[lkml]   [2009]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [patch 00/13] devtmpfs patches
    On Wed, May 13, 2009 at 15:20, David Howells <dhowells@redhat.com> wrote:
    > Kay Sievers <kay.sievers@vrfy.org> wrote:
    >
    >> +static struct cred *kern_cred;
    >
    > Can I suggest that you call your cred pointer dev_cred rather than kern_cred
    > so that the naming is consistent with the other globals variables?

    Sounds good.

    >> +     kern_cred = prepare_kernel_cred(NULL);
    >
    > If you have no intention of altering the credentials you create, you might
    > want to use &init_cred instead of kern_cred.  That said, you might want to
    > allocate it and let the security module alter it before you use it.

    Ah, didn't know that it was exported. It's the one in
    include/linux/init_task.h, right? I'll give that a try.

    > Also, Stephen is right, you should probably wrap all your accesses to the VFS
    > in your devtmpfs credentials.  For instance, devtmpfs_create_node() calls
    > vfs_mkdir() with the process's credentials via create_path() and directly with
    > the kern_cred.
    >
    > What you probably want is:

    > nodename = device_get_nodename(dev, &tmp);
    > if (!nodename)
    > return -ENOMEM;
    >                curr_cred = override_creds(kern_cred);
    ...
    >        out_name:
    >                revert_creds(curr_cred);

    Yeah, I have exactly that already now.

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

    \
     
     \ /
      Last update: 2009-05-13 15:37    [W:2.966 / U:0.388 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site