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: <20080426.180112.184545994.xiyou.wangcong@gmail.com>
Date:	Sat, 26 Apr 2008 18:01:12 +0800 (CST)
From:	WANG Cong <xiyou.wangcong@...il.com>
To:	jdike@...toit.com
Cc:	akpm@...l.org, linux-kernel@...r.kernel.org,
	user-mode-linux-devel@...ts.sourceforge.net
Subject: Re: [PATCH 2/19] UML - Tidy stub management code

From: Jeff Dike <jdike@...toit.com>
Date: Fri, 25 Apr 2008 13:56:06 -0400
> Restructure the stub management code to make it simpler.
> 
> syscall_stub_done is extracted from do_syscall_stub.
> 
> The counters are gone since I never looked at them.
> 
> The common code in run_syscall_stub and syscall_stub_data is extracted
> into flush_syscalls.
> 
> Signed-off-by: Jeff Dike <jdike@...ux.intel.com>
> ---
>  arch/um/os-Linux/skas/mem.c |  162 +++++++++++++++++++++++---------------------
>  1 file changed, 85 insertions(+), 77 deletions(-)
> 
> Index: linux-2.6-git/arch/um/os-Linux/skas/mem.c
> ===================================================================
> --- linux-2.6-git.orig/arch/um/os-Linux/skas/mem.c	2008-04-25 11:36:59.000000000 -0400
> +++ linux-2.6-git/arch/um/os-Linux/skas/mem.c	2008-04-25 11:39:07.000000000 -0400
> @@ -40,35 +40,69 @@ static unsigned long syscall_regs[MAX_RE
>  
>  static int __init init_syscall_regs(void)
>  {
> +	unsigned long *stub_entry;
> +
>  	get_safe_registers(syscall_regs);
> +	stub_entry = &batch_syscall_stub;
> +
>  	syscall_regs[REGS_IP_INDEX] = STUB_CODE +
> -		((unsigned long) &batch_syscall_stub -
> +		((unsigned long) stub_entry -
>  		 (unsigned long) &__syscall_stub_start);
>  	return 0;
>  }
>  
>  __initcall(init_syscall_regs);
>  
> -extern int proc_mm;
> +static int syscall_stub_done(unsigned long stack)
> +{
> +	unsigned long *syscall, *data, offset;
> +	int ret, n;
> +
> +	/*
> +	 * When the stub stops, we find the following values on the
> +	 * beginning of the stack:
> +	 * (long) return_value
> +	 * (long) offset to failed sycall data (0 if no error)
> +	 */
> +	ret = *((unsigned long *) stack);


I am afraid the value will be truncated on 64bit machine, since
'ret' is 'int' while 'stack' points to an 'unsigned long'.

Is this expected?

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