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]
Message-ID: <17641.30.670343.779791@cargo.ozlabs.ibm.com>
Date:	Mon, 21 Aug 2006 10:36:46 +1000
From:	Paul Mackerras <paulus@...ba.org>
To:	Arnd Bergmann <arnd@...db.de>
Cc:	Björn Steinbrink <B.Steinbrink@....de>,
	Russell King <rmk+lkml@....linux.org.uk>,
	Andrew Morton <akpm@...l.org>, rusty@...tcorp.com.au,
	linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org
Subject: Re: [PATCH] introduce kernel_execve function to replace __KERNEL_SYSCALLS__

Arnd Bergmann writes:

> Iit turned out most of the architectures that already implement
> their own execve() call instead of using the _syscall3 function
> for it end up passing the return value of sys_execve down, 
> instead of setting errno.

I really don't like having an "errno" variable in the kernel.  What if
two processes are doing an execve concurrently?

Anyway, your patch returns the (positive) errno value here:

> +	WARN_ON(segment_eq(fs, USER_DS));
> +	ret = execve(filename, (char **)argv, (char **)envp);
> +	if (ret)
> +		ret = errno;
> +
> +	return ret;

but here we are testing for a negative value to mean error:

> -	if (execve("/sbin/shutdown", argv, envp) < 0) {
> +	if (kernel_execve("/sbin/shutdown", argv, envp) < 0) {

Paul.
-
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