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:	Sun, 20 Aug 2006 15:47:45 +0200
From:	Björn Steinbrink <B.Steinbrink@....de>
To:	Arnd Bergmann <arnd@...db.de>
Cc:	Russell King <rmk+lkml@....linux.org.uk>,
	Andrew Morton <akpm@...l.org>, rusty@...tcorp.com.au,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Return real errno from execve in ____call_usermodehelper

On 2006.08.20 15:01:28 +0200, Arnd Bergmann wrote:
> On Saturday 19 August 2006 10:42, Russell King wrote:
> > Maybe what we should be thinking of doing is changing execve() calls
> > to kernel_execve() which returns the error code.
> > 
> > This way, architectures are free to implement execve() whatever way
> > they wish - and if they're concerned about using errno, that's their
> > own implementation specific detail.
> 
> Sounds good, it means we could finally kill __KERNEL_SYSCALLS__ along
> with lib/errno.c.
> 
> I guess a fallback for those that haven't yet done kernel_execve could be
> 
> #ifdef CONFIG_ARCH_KERNEL_EXECVE
> extern int kernel_execve(const char *filename,
> 		char *const argv[], char *const envp[]);
> #else
> static inline int kernel_execve(const char *filename,
> 		char *const argv[], char *const envp[]);
> {
> 	int errno;
> 	mm_segment_t old_fs = get_fs();
> 	set_fs(KERNEL_DS);
> 	/* the kernel syscall macro modifies errno */
> 	execve(filename, argv, envp);
> 	set_fs(old_fs);
> 	return errno;
> }
> #endif
> 
> With that in place, we can remove the global errno right away, and the
> kernel syscalls for any architecture that implements its own kernel_execve.

How is execve() supposed to use the local errno? The kernel syscall
macro only "creates" a function, so you still need a global errno for
that code, don't you?

And I (because I'm clueless ;) wonder about the calls to set_fs(), why
do we need them? The current code does not seem to do them. Or is there
something special about kernel_execve that I'm missing? cscope and grep
didn't tell anything and Google had only a few useless results for
kernel_execve.

Björn
-
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