From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 000C0C04A6B for ; Fri, 10 May 2019 16:41:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C8E9D216C4 for ; Fri, 10 May 2019 16:41:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727866AbfEJQlC (ORCPT ); Fri, 10 May 2019 12:41:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:55196 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727810AbfEJQlB (ORCPT ); Fri, 10 May 2019 12:41:01 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8EC6221479; Fri, 10 May 2019 16:40:59 +0000 (UTC) Date: Fri, 10 May 2019 12:40:58 -0400 From: Steven Rostedt To: Martin Schwidefsky Cc: Petr Mladek , Linus Torvalds , Andy Shevchenko , Rasmus Villemoes , "Tobin C . Harding" , Michal Hocko , Sergey Senozhatsky , Sergey Senozhatsky , linux-kernel@vger.kernel.org, Michael Ellerman , linuxppc-dev@lists.ozlabs.org, Russell Currey , Christophe Leroy , Stephen Rothwell , Heiko Carstens , linux-arch@vger.kernel.org, linux-s390@vger.kernel.org Subject: Re: [PATCH] vsprintf: Do not break early boot with probing addresses Message-ID: <20190510124058.0d44b441@gandalf.local.home> In-Reply-To: <20190510183258.1f6c4153@mschwideX1> References: <20190510081635.GA4533@jagdpanzerIV> <20190510084213.22149-1-pmladek@suse.com> <20190510122401.21a598f6@gandalf.local.home> <20190510183258.1f6c4153@mschwideX1> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 10 May 2019 18:32:58 +0200 Martin Schwidefsky wrote: > On Fri, 10 May 2019 12:24:01 -0400 > Steven Rostedt wrote: > > > On Fri, 10 May 2019 10:42:13 +0200 > > Petr Mladek wrote: > > > > > static const char *check_pointer_msg(const void *ptr) > > > { > > > - char byte; > > > - > > > if (!ptr) > > > return "(null)"; > > > > > > - if (probe_kernel_address(ptr, byte)) > > > + if ((unsigned long)ptr < PAGE_SIZE || IS_ERR_VALUE(ptr)) > > > return "(efault)"; > > > > > > > > > < PAGE_SIZE ? > > > > do you mean: < TASK_SIZE ? > > The check with < TASK_SIZE would break on s390. The 'ptr' is > in the kernel address space, *not* in the user address space. > Remember s390 has two separate address spaces for kernel/user > the check < TASK_SIZE only makes sense with a __user pointer. > So we allow this to read user addresses? Can't that cause a fault? If the condition is true, we return "(efault)". -- Steve