Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2332229yba; Fri, 10 May 2019 09:43:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqxRHjZmhC5bt4wo1OQSeA+3gGQfNTmdmSSXuau06zoqVn/m/Au2SMQe0wuZuYIC3UcL6yEg X-Received: by 2002:a63:de0a:: with SMTP id f10mr14883297pgg.418.1557506628664; Fri, 10 May 2019 09:43:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557506628; cv=none; d=google.com; s=arc-20160816; b=MXlUP2B2N2HIq/TPvILi7SBoG9hIXUsZ4AYBLj/ANu+feSfvUzIXKUZNV4+EmwD9FE vqUdwXGG7lbdUqi/hcvaCT2O8cFN3hoqA4duOWXDMZfF1hWe2gKEFgGeKBwTxYzu9UM+ wcTKzWfCR3p5q90cTFM2PVnFHsZjf6J3zUVhdoY6N73OmU7hMs9qX7tUGRK4ySJM+mHb GgEPTXxRPNvDv5hYkHp9VK6tI16H2QRuGeCvIohG6e+krsXhVVz9N3Ka3Op6XivrwPai 2Y4+j1vllGx38G0loxeO+8hAUyDs3CmGuPycfgdmXgj2WNKRJqQ7vKLBuMYfYWfmxpYf dYkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=Qi6f2S3CXB6dS0ScJ4tuvGkum4kZqvAINU2g1Kp5YuU=; b=OcNGYnvfXAvmM3SnDuleUucM6820EcYkgdeufcgdatuSIZjqEEx9BADT8P7rQbyOfg RFixVMkSIDSu3iup/ii4U29hnNASl3qoCGLG59qQJatwQ1J5WKFFgryJYFvjFh02BFBI 7xgi+zziWaGhRX3koeXbvIEtpS5Mr3HFiXSokaBylwUtC6E7dZqaAKF9nbe02JZ55Itd z3L2ma+3X1BgvqAa/ZFsnyzv8GIP9kabTLb6xukIZyLfjHOnk1b8f+2p9JClFn4x8hHH 6FE/mjbwgSmg4R65OuY+WDySjHkKXO8E7VbAD6ZoYwsPKxqhw488sWe5RYYF2trRztQW bLqg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n1si8531598pld.61.2019.05.10.09.43.32; Fri, 10 May 2019 09:43:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727857AbfEJQlC (ORCPT + 99 others); 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