lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 19 Aug 2006 01:14:28 -0700
From:	Andrew Morton <akpm@...l.org>
To:	Björn Steinbrink <B.Steinbrink@....de>
Cc:	rusty@...tcorp.com.au, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Return real errno from execve in
 ____call_usermodehelper

On Sat, 19 Aug 2006 09:30:31 +0200
Björn Steinbrink <B.Steinbrink@....de> wrote:

> 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@....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;

ug.  I wish we could find some way of using do_execve() here.  Or hoist
sys_execve() out of the architectures.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ