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:	Mon, 21 Dec 2015 01:20:51 +0100
From:	Richard Weinberger <richard@....at>
To:	Mickaël Salaün <mic@...ikod.net>,
	linux-kernel@...r.kernel.org
Cc:	Jonathan Corbet <corbet@....net>, Jeff Dike <jdike@...toit.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	"H . Peter Anvin" <hpa@...or.com>, x86@...nel.org,
	Kees Cook <keescook@...omium.org>,
	Andy Lutomirski <luto@...capital.net>,
	Will Drewry <wad@...omium.org>,
	Shuah Khan <shuahkh@....samsung.com>,
	Chris Metcalf <cmetcalf@...hip.com>,
	Michael Ellerman <mpe@...erman.id.au>,
	Andrew Morton <akpm@...ux-foundation.org>,
	James Hogan <james.hogan@...tec.com>,
	Thomas Meyer <thomas@...3r.de>,
	Nicolas Iooss <nicolas.iooss_linux@....org>,
	Anton Ivanov <aivanov@...cade.com>, linux-doc@...r.kernel.org,
	user-mode-linux-devel@...ts.sourceforge.net,
	user-mode-linux-user@...ts.sourceforge.net,
	linux-api@...r.kernel.org,
	Meredydd Luff <meredydd@...atehouse.org>,
	David Drysdale <drysdale@...gle.com>
Subject: Re: [PATCH v1 1/4] um: Fix ptrace GETREGS/SETREGS bugs

Am 21.12.2015 um 01:03 schrieb Mickaël Salaün:
> This fix two related bugs:
> * PTRACE_GETREGS doesn't get the right orig_ax (syscall) value
> * PTRACE_SETREGS can't set the orig_ax value (erased by initial value)
> 
> Remove the now useless and error-prone get_syscall().
> 
> Signed-off-by: Mickaël Salaün <mic@...ikod.net>
> Cc: Jeff Dike <jdike@...toit.com>
> Cc: Richard Weinberger <richard@....at>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Kees Cook <keescook@...omium.org>
> Cc: Andy Lutomirski <luto@...capital.net>
> Cc: Will Drewry <wad@...omium.org>
> Cc: Thomas Meyer <thomas@...3r.de>
> Cc: Nicolas Iooss <nicolas.iooss_linux@....org>
> Cc: Anton Ivanov <aivanov@...cade.com>
> Cc: linux-kernel@...r.kernel.org
> Cc: user-mode-linux-devel@...ts.sourceforge.net
> Cc: user-mode-linux-user@...ts.sourceforge.net
> Cc: Meredydd Luff <meredydd@...atehouse.org>
> Cc: David Drysdale <drysdale@...gle.com>
> ---
>  arch/um/kernel/skas/syscall.c   | 7 ++++++-
>  arch/um/os-Linux/skas/process.c | 7 -------
>  2 files changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/um/kernel/skas/syscall.c b/arch/um/kernel/skas/syscall.c
> index 1683b8e..65f0d1a 100644
> --- a/arch/um/kernel/skas/syscall.c
> +++ b/arch/um/kernel/skas/syscall.c
> @@ -7,6 +7,7 @@
>  #include <linux/ptrace.h>
>  #include <kern_util.h>
>  #include <sysdep/ptrace.h>
> +#include <sysdep/ptrace_user.h>
>  #include <sysdep/syscalls.h>
>  #include <os.h>
>  
> @@ -16,12 +17,16 @@ void handle_syscall(struct uml_pt_regs *r)
>  	long result;
>  	int syscall;
>  
> +	/* Save the syscall register. */
> +	UPT_SYSCALL_NR(r) = PT_SYSCALL_NR(r->gp);
> +
>  	if (syscall_trace_enter(regs)) {
>  		result = -ENOSYS;
>  		goto out;
>  	}
>  
> -	syscall = get_syscall(r);
> +	/* Get the syscall after being potentially updated with ptrace. */
> +	syscall = UPT_SYSCALL_NR(r);

Doesn't this break the support for changing syscall numbers using PTRACE_SETREGS?

Thanks,
//richard
--
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