From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Brown Subject: Re: [PATCH] ASoC: soc-core: Support debugfs entries larger than PAGE_SIZE bytes Date: Wed, 2 Feb 2011 13:37:12 +0000 Message-ID: <20110202133712.GQ12743@opensource.wolfsonmicro.com> References: <1296646145-2356-1-git-send-email-dp@opensource.wolfsonmicro.com> <20110202130741.GP12743@opensource.wolfsonmicro.com> <1296653296.4393.1.camel@dplaptop.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from opensource2.wolfsonmicro.com (opensource.wolfsonmicro.com [80.75.67.52]) by alsa0.perex.cz (Postfix) with ESMTP id 57FF4103823 for ; Wed, 2 Feb 2011 14:37:15 +0100 (CET) Content-Disposition: inline In-Reply-To: <1296653296.4393.1.camel@dplaptop.localdomain> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Dimitris Papastamos Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com, Liam Girdwood List-Id: alsa-devel@alsa-project.org 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.