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: <20100210191240.DC9E4CC@magilla.sf.frob.com>
Date:	Wed, 10 Feb 2010 11:12:40 -0800 (PST)
From:	Roland McGrath <roland@...hat.com>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	Suresh Siddha <suresh.b.siddha@...el.com>,
	"H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...e.hu>,
	Thomas Gleixner <tglx@...utronix.de>,
	LKML <linux-kernel@...r.kernel.org>, hjl.tools@...il.com
Subject: Re: [patch v2 4/4] ptrace: Add support for generic
	PTRACE_GETREGSET/PTRACE_SETREGSET

> +static int ptrace_regset(struct task_struct *task, int req, unsigned int type,
> +			struct iovec *uiov)
			       	     ^__user
> +{
> +	const struct user_regset_view *view = task_user_regset_view(task);
> +	const struct user_regset *regset = find_regset(view, type);
> +	struct iovec kiov;
> +
> +	if (!regset)
> +		return -EIO;
> +
> +	if (copy_from_user(&kiov, uiov, sizeof kiov))
> +		return -EFAULT;

Since it's just two words, most places handling struct iovec seem to just
use two get_user() calls, which is probably more efficient.

Also, here is where this function would need to be split in half for
compat_ptrace_request() calls where it has to use struct compat_iovec.

> +	// I am not sure. Afaics it is OK to pass the
> +	// size which is less than n * size. If iov_len
> +	// is bigger, we can silently truncate it, or
> +	// even write the correct value back.

Modifying iov_len to report how much we accessed seems good to me.  If we
do that, we should certainly allow a larger size for get, so userland can
just use a generic large buffer before even knowing the real size.  I'm not
sure whether we should allow a smaller size, especially for set.  I could
go either way.


Thanks,
Roland
--
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