Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2336654yba; Fri, 10 May 2019 09:48:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqx/uAmIoWiOD4M753CRClwjarQ6vY0ahBOxRUOBxiQ9vs3ZcSeCJhhgPl9AKhGm6/Wt6VyL X-Received: by 2002:a17:902:2bca:: with SMTP id l68mr13817979plb.301.1557506898537; Fri, 10 May 2019 09:48:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557506898; cv=none; d=google.com; s=arc-20160816; b=0Aed/t/t1IPY/H47h1UKUbmeCfWLh2898t/CZfjg9VVemnuS+AlR/zmoQLBz9b45pS PimblG/c9nBNQlyCxGK5tm9aq4EU2wJ3WwPdCXHqD7lDAetOy/cgjLe/nSUODqED+xLG 4k7ijyB1wv+kHsMx6dv3Heu7Y8kjtxtVLcXc8dKcnQ8rz7GIhOfcx7Fcwo5HVHCFHRfc flwlzORHbNS7qFZ+NIyS+2rUY4tB82zmo/HpGSuFggspdFyPbpWwFaz4/Xy7JfrQsA7c YKqjeOQ0nslSmZlid+WBtEKlmAcR9o7LvJ93KqM29UjX0zw+//RszzdCj6CjGTg2U2AB R3xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:subject:cc:to:from:date; bh=sW9pttAeOTrTmOKMUvKfHsEkQtBBoOblnDXTUvf3WRI=; b=f+KD0ZQpypsWIApAa0uz85j/1kUJPqdPTldbXhhIst6XG4bTcEaH0p4rwHS13Zk2/M EvgbQRXtQtjTwRb29pXHnu2QDLKUnyG70AFcALH7x4nAontMgoNl/4vfcZNxzQ4ElUF/ G5XP5CQf17K+yFYLlSmFF5XB/2lQZTLIAa4aMFC+NOKhy9+eaUX0qDsrT4J+g+ZV4S9P tt1dO1tadNg3TnrM5xEpnkc3hM7am08SBL/YBkyWiEvNJkKHVhNTgnyBCIpK4XcAgrCd vs3oKC2Yr1FIPQ5aGSuRv9JQAYbOKmNA6bPDBIhdmzX5C9rPWJS6YdREkfB28J5gxfZR hQJw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cp18si8146557plb.271.2019.05.10.09.48.02; Fri, 10 May 2019 09:48:18 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727811AbfEJQqB (ORCPT + 99 others); Fri, 10 May 2019 12:46:01 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:49202 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727725AbfEJQqA (ORCPT ); Fri, 10 May 2019 12:46:00 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4AGcW0G124527 for ; Fri, 10 May 2019 12:45:59 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0b-001b2d01.pphosted.com with ESMTP id 2sdb5rd2fp-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 10 May 2019 12:45:59 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 10 May 2019 17:45:57 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 10 May 2019 17:45:51 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x4AGjoHK51576876 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 May 2019 16:45:50 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 84A005204F; Fri, 10 May 2019 16:45:50 +0000 (GMT) Received: from mschwideX1 (unknown [9.145.32.174]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id E268752050; Fri, 10 May 2019 16:45:49 +0000 (GMT) Date: Fri, 10 May 2019 18:45:48 +0200 From: Martin Schwidefsky To: Steven Rostedt 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 In-Reply-To: <20190510124058.0d44b441@gandalf.local.home> References: <20190510081635.GA4533@jagdpanzerIV> <20190510084213.22149-1-pmladek@suse.com> <20190510122401.21a598f6@gandalf.local.home> <20190510183258.1f6c4153@mschwideX1> <20190510124058.0d44b441@gandalf.local.home> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 19051016-0020-0000-0000-0000033B63F6 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19051016-0021-0000-0000-0000218E116C Message-Id: <20190510184548.1eda01a9@mschwideX1> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-05-09_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=870 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905100112 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 10 May 2019 12:40:58 -0400 Steven Rostedt wrote: > 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)". On x86 this would allow a user space access as kernel and user live in the same address space, on s390 it would not. h -- blue skies, Martin. "Reality continues to ruin my life." - Calvin.