From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1037241AbdE0BOe (ORCPT ); Fri, 26 May 2017 21:14:34 -0400 Received: from mail-oi0-f42.google.com ([209.85.218.42]:33487 "EHLO mail-oi0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S944912AbdEZUhD (ORCPT ); Fri, 26 May 2017 16:37:03 -0400 MIME-Version: 1.0 In-Reply-To: References: From: Arnd Bergmann Date: Fri, 26 May 2017 22:37:02 +0200 X-Google-Sender-Auth: FjAUP8IeP0aC-nl4bwQvyWM91MQ Message-ID: Subject: Re: arm64 test_user_copy crash on copy_from_user(uptr, kptr, size) To: Kees Cook Cc: Catalin Marinas , Linux ARM , Linux Kernel Mailing List , "the arch/x86 maintainers" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 26, 2017 at 5:41 PM, Kees Cook wrote: > On Fri, May 26, 2017 at 8:24 AM, Arnd Bergmann wrote: >> A kselftest run on arm64 on an older 4.4.y stable kernel ran into an >> unexpectedly trapping user space access: >> >> [ 1277.857738] Internal error: Accessing user space memory outside >> uaccess.h routines: 96000045 [#1] PREEMPT SMP >> >> Apparently the same thing happens on x86 as well, and it still happens on >> the latest kernels, see https://bugs.linaro.org/show_bug.cgi?id=3011 >> >> The problem here is this test >> >> ret |= test(!copy_from_user(bad_usermem, (char __user *)kmem, >> PAGE_SIZE), >> "illegal reversed copy_from_user passed"); > > Hi! Yes, I removed that test from the current code: > > #if 0 > /* > * When running with SMAP/PAN/etc, this will Oops the kernel > * due to the zeroing of userspace memory on failure. This needs > * to be tested in LKDTM instead, since this test module does not > * expect to explode. > */ > ret |= test(!copy_from_user(bad_usermem, (char __user *)kmem, > PAGE_SIZE), > "illegal reversed copy_from_user passed"); > #endif > > We can send a patch to -stable? Ok, good. I've prepared a backport since it doesn't apply cleanly otherwise. Arnd