[alsa-devel] [PATCH] ASoC: soc-core: Support debugfs entries larger than PAGE_SIZE bytes

Mark Brown broonie at opensource.wolfsonmicro.com
Wed Feb 2 14:37:12 CET 2011


On Wed, Feb 02, 2011 at 01:28:16PM +0000, Dimitris Papastamos wrote:
> On Wed, 2011-02-02 at 13:07 +0000, Mark Brown wrote:

> > Why do we need the access_ok() here?  I'd really expect copy_to_user()
> > to do the right thing here and simple_read_from_buffer() doesn't do
> > this.

> I thought it'd be a problem if userspace provides a pointer that points
> in kernelspace.  The call to access_ok() ensures that the pointer lies
> indeed in userspace.  I noticed that simple_read_from_buffer() doesn't
> do this, but I did not see how this could harm things.

My expectation is that access_ok() would only be used if we were parsing
userspace passed values directly, having to do the check before doing a
copy_to_user() reads like we're doing something wrong.


More information about the Alsa-devel mailing list