lkml.org 
[lkml]   [2010]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH] KEYS: The request_key() syscall should link an existing key to the dest keyring
    Date
    Vegard Nossum <vegard.nossum@gmail.com> wrote:

    > 1. Is it correct to return -EINPROGRESS in this case?

    Yes - it prevents construct_key_and_link() from going on to call
    construct_key(). The key in question is returned in *_key.

    However, I don't think I handle other errors coming back from
    construct_alloc_key() correctly.

    > 2. (Why) Shouldn't the return value of __key_link() be checked?

    It should. In fact, I should probably precheck and preallocate the keyring to
    make sure I don't get errors after allocating the new key.

    > 3. In __key_link(), shouldn't rcu_dereference() be used when accessing
    > keyring->payload.subscriptions?

    No. We have to hold a write lock on the keyring semaphore if we're going to
    call __key_link() to add something to it.

    We should, however, call rcu_dereference_protected().

    You should find a patch for this in your inbox.

    David


    \
     
     \ /
      Last update: 2010-04-28 17:01    [W:0.029 / U:118.528 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site