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=unavailable 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 AECCBC04A6B for ; Fri, 10 May 2019 16:42:43 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 20D9520578 for ; Fri, 10 May 2019 16:42:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 20D9520578 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 450wxF4MpzzDqWP for ; Sat, 11 May 2019 02:42:41 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=kernel.org (client-ip=198.145.29.99; helo=mail.kernel.org; envelope-from=srs0=xlfc=tk=goodmis.org=rostedt@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=goodmis.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 450wvM15RwzDqT6 for ; Sat, 11 May 2019 02:41:03 +1000 (AEST) 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 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 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Petr Mladek , linux-arch@vger.kernel.org, Sergey Senozhatsky , Heiko Carstens , linux-s390@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Rasmus Villemoes , linux-kernel@vger.kernel.org, Michal Hocko , Sergey Senozhatsky , Stephen Rothwell , Andy Shevchenko , Linus Torvalds , "Tobin C . Harding" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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