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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <50FD03C6.1060000@6wind.com>
Date:	Mon, 21 Jan 2013 10:00:54 +0100
From:	Nicolas Dichtel <nicolas.dichtel@...nd.com>
To:	Al Viro <viro@...IV.linux.org.uk>
CC:	Linus Torvalds <torvalds@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: Issues with "x86, um: switch to generic fork/vfork/clone" commit

Le 20/01/2013 04:12, Al Viro a écrit :
> On Sat, Jan 19, 2013 at 06:38:08AM +0000, Al Viro wrote:
>>> [   64.313636] kbd[2563]: segfault at 9fe ip 000009fe sp b758293c
>>> error 4 in dash[8048000+18000]
>>>
>>> After bisecting, the following commit seems responsible:
>>> 1d4b4b2994b5fc208963c0b795291f8c1f18becf (x86, um: switch to generic
>>> fork/vfork/clone)
>>
>> Er...  Bisect of the guest kernel, I take it?  Could you check if building
>> the guest !SMP affects anything?
>
> OK...  I think I understand what's going on.  We need asmlinkage_protect
> in sys_clone() ;-/  For what it's worth, I really wonder if we ought to
> treat that as syscall wrappers - i.e. have SYSCALL_DEFINEx on i386 add
> a wrapper that would do asmlinkage_protect itself.  IMO it's the same kind
> of thing as argument normalization handled by syscall wrappers - we make
> sure that C function plays well with what asm glue is doing and expecting.
>
> Anyway, the following seems to fix the problem here (and yes, I could reproduce
> it with your config); could you verify that it fixes things on your setup?
Yes, I confirm it's fixed with this patch.

> If it does, this sucker should go into mainline and -stable...
>
> diff --git a/kernel/fork.c b/kernel/fork.c
> index a31b823..e05cff2 100644
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -1660,8 +1660,10 @@ SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
>   		 int, tls_val)
>   #endif
>   {
> -	return do_fork(clone_flags, newsp, 0,
> -		parent_tidptr, child_tidptr);
> +	long ret = do_fork(clone_flags, newsp, 0, parent_tidptr, child_tidptr);
> +	asmlinkage_protect(5, ret, clone_flags, newsp,
> +			parent_tidptr, child_tidptr, tls_val);
> +	return ret;
>   }
>   #endif
>
>
--
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