From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH V9 14/21] csky: User access Date: Wed, 17 Oct 2018 17:37:38 +0200 Message-ID: References: <1c0d8cddcdf15e5f397b3e42b76461e97d6e34ad.1539655732.git.ren_guo@c-sky.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: <1c0d8cddcdf15e5f397b3e42b76461e97d6e34ad.1539655732.git.ren_guo@c-sky.com> Sender: linux-kernel-owner@vger.kernel.org To: Guo Ren Cc: Andrew Morton , Daniel Lezcano , David Miller , gregkh , Christoph Hellwig , Marc Zyngier , Mark Rutland , Peter Zijlstra , Rob Herring , Thomas Gleixner , Linux Kernel Mailing List , linux-arch , DTML , Rob Herring , c-sky_gcc_upstream@c-sky.com List-Id: linux-arch.vger.kernel.org On Tue, Oct 16, 2018 at 5:05 AM Guo Ren wrote: > > The patch adds "user access from kernel" codes. > > Signed-off-by: Guo Ren > Cc: Arnd Bergmann > --- > arch/csky/include/asm/uaccess.h | 416 ++++++++++++++++++++++++++++++++++++++++ > arch/csky/lib/usercopy.c | 262 +++++++++++++++++++++++++ > 2 files changed, 678 insertions(+) > create mode 100644 arch/csky/include/asm/uaccess.h > create mode 100644 arch/csky/lib/usercopy.c Reviewed-by: Arnd Bergmann The 64-bit __put_user() is usually what everyone gets wrong, but your version seems fine. Also the access_ok() checks and the copy_to_user() result value all look correct. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-f196.google.com ([209.85.222.196]:40058 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727048AbeJQXeK (ORCPT ); Wed, 17 Oct 2018 19:34:10 -0400 MIME-Version: 1.0 References: <1c0d8cddcdf15e5f397b3e42b76461e97d6e34ad.1539655732.git.ren_guo@c-sky.com> In-Reply-To: <1c0d8cddcdf15e5f397b3e42b76461e97d6e34ad.1539655732.git.ren_guo@c-sky.com> From: Arnd Bergmann Date: Wed, 17 Oct 2018 17:37:38 +0200 Message-ID: Subject: Re: [PATCH V9 14/21] csky: User access Content-Type: text/plain; charset="UTF-8" Sender: linux-arch-owner@vger.kernel.org List-ID: To: Guo Ren Cc: Andrew Morton , Daniel Lezcano , David Miller , gregkh , Christoph Hellwig , Marc Zyngier , Mark Rutland , Peter Zijlstra , Rob Herring , Thomas Gleixner , Linux Kernel Mailing List , linux-arch , DTML , Rob Herring , c-sky_gcc_upstream@c-sky.com Message-ID: <20181017153738.18A6HIgN42FdKPncOD6EnQKsQPhmYVTq0T_0ckkBjnc@z> On Tue, Oct 16, 2018 at 5:05 AM Guo Ren wrote: > > The patch adds "user access from kernel" codes. > > Signed-off-by: Guo Ren > Cc: Arnd Bergmann > --- > arch/csky/include/asm/uaccess.h | 416 ++++++++++++++++++++++++++++++++++++++++ > arch/csky/lib/usercopy.c | 262 +++++++++++++++++++++++++ > 2 files changed, 678 insertions(+) > create mode 100644 arch/csky/include/asm/uaccess.h > create mode 100644 arch/csky/lib/usercopy.c Reviewed-by: Arnd Bergmann The 64-bit __put_user() is usually what everyone gets wrong, but your version seems fine. Also the access_ok() checks and the copy_to_user() result value all look correct. Arnd