Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750990AbdFOFYr (ORCPT ); Thu, 15 Jun 2017 01:24:47 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46656 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750781AbdFOFYq (ORCPT ); Thu, 15 Jun 2017 01:24:46 -0400 Date: Thu, 15 Jun 2017 07:24:37 +0200 From: Greg KH To: "Edward A. James" Cc: linux-kernel@vger.kernel.org, bradleyb@fuzziesquirrel.com, jk@ozlabs.org, cbostic@linux.vnet.ibm.com, joel@jms.id.au, andrew@aj.id.au Subject: Re: [PATCH linux] drivers/fsi: Add SBEFIFO FSI client device driver Message-ID: <20170615052437.GA29481@kroah.com> References: <1497469647-4608-1-git-send-email-eajames@us.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1497469647-4608-1-git-send-email-eajames@us.ibm.com> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 483 Lines: 19 On Wed, Jun 14, 2017 at 02:47:27PM -0500, Edward A. James wrote: > +static ssize_t sbefifo_read(struct file *file, char __user *buf, > + size_t len, loff_t *offset) > +{ > + struct sbefifo_client *client = file->private_data; > + > + WARN_ON(*offset); Huh? Why? > + if (!access_ok(VERIFY_WRITE, buf, len)) > + return -EFAULT; What does this check? You should never need to call access_ok in any driver, copy_from/to_user handles that all for you just fine. thanks, greg k-h