lkml.org 
[lkml]   [2006]   [Aug]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH] Return real errno from execve in ____call_usermodehelper
    If execve fails in ____call_usermodehelper we treat its return value as
    error code, but as execve is a syscall, we actually want -errno there.

    Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>

    --

    diff --git a/kernel/kmod.c b/kernel/kmod.c
    index 1d32def..865abc0 100644
    --- a/kernel/kmod.c
    +++ b/kernel/kmod.c
    @@ -149,8 +149,10 @@ static int ____call_usermodehelper(void
    set_cpus_allowed(current, CPU_MASK_ALL);

    retval = -EPERM;
    - if (current->fs->root)
    - retval = execve(sub_info->path, sub_info->argv,sub_info->envp);
    + if (current->fs->root) {
    + execve(sub_info->path, sub_info->argv, sub_info->envp);
    + retval = -errno;
    + }

    /* Exec failed? */
    sub_info->retval = retval;
    -
    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: 2006-08-19 09:35    [W:0.043 / U:92.580 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site