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:	Thu, 29 Nov 2007 23:58:52 +0300
From:	Alexey Dobriyan <adobriyan@...il.com>
To:	Roland McGrath <roland@...hat.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...e.hu>, "H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH x86/mm 09/11] x86 ia32 ptrace arch merge

On Thu, Nov 29, 2007 at 04:00:41AM -0800, Roland McGrath wrote:
> This moves the sys32_ptrace code into arch/x86/kernel/ptrace.c,
> verbatim except for a few hard-coded sizes replaced with sizeof.
> Here this code can use the shared local functions in this file.

> --- a/arch/x86/kernel/ptrace.c
> +++ b/arch/x86/kernel/ptrace.c

> +asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data)
> +{
> +	struct task_struct *child;
> +	struct pt_regs *childregs;
> +	void __user *datap = compat_ptr(data);
> +	int ret;
> +	__u32 val;
> +
> +	switch (request) {
> +	case PTRACE_PEEKDATA:
> +	case PTRACE_PEEKTEXT:
> +		ret = 0;

Dead write.

> +		if (access_process_vm(child, addr, &val, sizeof(u32), 0) !=
> +		    sizeof(u32))
> +			ret = -EIO;
> +		else
> +			ret = put_user(val, (unsigned int __user *)datap);
> +		break;

> +	case PTRACE_GETFPREGS:
> +		ret = -EIO;
> +		if (!access_ok(VERIFY_READ, compat_ptr(data),
> +			       sizeof(struct user_i387_struct)))
> +			break;
> +		save_i387_ia32(child, datap, childregs, 1);
> +		ret = 0;
> +			break;

More indentation than needed.

> +	case PTRACE_GETFPXREGS: {
> +		struct user32_fxsr_struct __user *u = datap;
> +
> +		init_fpu(child);
> +		ret = -EIO;
> +		if (!access_ok(VERIFY_WRITE, u, sizeof(*u)))
> +			break;
> +			ret = -EFAULT;

Absent { }. :^)

> +		if (__copy_to_user(u, &child->thread.i387.fxsave, sizeof(*u)))
> +			break;
> +		ret = __put_user(childregs->cs, &u->fcs);
> +		ret |= __put_user(child->thread.ds, &u->fos);
> +		break;
> +	}
-
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