Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4934597yba; Mon, 13 May 2019 02:19:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqy69gshtJBRhjjgD6WXCYmLf3DkHqOtJH7KJAMfQpLGZcGuqvrYR1mo1HPHdM/iw7CKYOMO X-Received: by 2002:a63:e042:: with SMTP id n2mr28808417pgj.201.1557739159097; Mon, 13 May 2019 02:19:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557739159; cv=none; d=google.com; s=arc-20160816; b=ymM/jp4DRzie5mbhxn1Xodvwq/0ni+Q8EFbg9aEzQ3TEC9ZvC60Gor7m0Puulej/OM h43e3Jvr4h09IWQFpzc5OmWAOSzIs0w9w9kaO+m+In4ZbpDTdR5dUCvSq8bcDS7E0C1b oRksH2cFfd2SwjgrMthNe79JdrhwSu1Tsq52eRXDxYvzrRxyQ1D+OPGabhHn40wrHyNm gQAOLi0dgDchIHmcSH7ItsAUnlSB8KEOyKA/y/MEKLMLFIiZGM4pYie0mYJvp0vYzhSh UiKPGFjqfRjrc4JxNIKVaY9Bn27XwV86UrdDhjkARPVoUluK0XDi8KcCLv9x7u9lLZs/ m8oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=1RSc6jG1DgEbYSKCpa1mes3PAwbKBwDkyoRY6ZsbU1o=; b=oWFB0Fp3Blf8t8c8Cx2ox4c1b/jG7vGcmRsiDu18ZT4e5MMnW5+rULDetz0eEOjcbz G1PozcZZR5ozI5LSCQRU8u9k1jHpAELufBzd24GeI7Q9dnxYXK+c32i2L6U6oRPWHJNo yRuOHlvNXQsg26TMUv3pixNMyPpMXqZsGinrCTy08HfLvkTv+3NiFFhx8elL5inioDGL zk6pjEkK/43F5rDnEOPDZxvGiVMsGV2OwwadNOc5ZjH8aNvNbGwSsUi1hKFiCQTDfQ3p nprNUc/BN1T+jZSsZP35T0CC9YyI2R82LouP/xFOl9ulrrSayEltiGbsehsddGeEzSBm b3vw== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u9si6144932pfn.253.2019.05.13.02.19.03; Mon, 13 May 2019 02:19:19 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728628AbfEMJN3 (ORCPT + 99 others); Mon, 13 May 2019 05:13:29 -0400 Received: from mga07.intel.com ([134.134.136.100]:34770 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728616AbfEMJN1 (ORCPT ); Mon, 13 May 2019 05:13:27 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 May 2019 02:13:26 -0700 X-ExtLoop1: 1 Received: from smile.fi.intel.com (HELO smile) ([10.237.72.86]) by orsmga007.jf.intel.com with ESMTP; 13 May 2019 02:13:21 -0700 Received: from andy by smile with local (Exim 4.92) (envelope-from ) id 1hQ71M-0007f0-23; Mon, 13 May 2019 12:13:20 +0300 Date: Mon, 13 May 2019 12:13:20 +0300 From: Andy Shevchenko To: David Laight Cc: 'christophe leroy' , Steven Rostedt , Petr Mladek , Linus Torvalds , 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 , Stephen Rothwell , Heiko Carstens , "linux-arch@vger.kernel.org" , "linux-s390@vger.kernel.org" , Martin Schwidefsky Subject: Re: [PATCH] vsprintf: Do not break early boot with probing addresses Message-ID: <20190513091320.GK9224@smile.fi.intel.com> References: <20190510081635.GA4533@jagdpanzerIV> <20190510084213.22149-1-pmladek@suse.com> <20190510122401.21a598f6@gandalf.local.home> <096d6c9c17b3484484d9d9d3f3aa3a7c@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <096d6c9c17b3484484d9d9d3f3aa3a7c@AcuMS.aculab.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 13, 2019 at 08:52:41AM +0000, David Laight wrote: > From: christophe leroy > > Sent: 10 May 2019 18:35 > > Le 10/05/2019 ? 18:24, Steven Rostedt a ?crit?: > > > On Fri, 10 May 2019 10:42:13 +0200 > > > Petr Mladek wrote: > > >> - if (probe_kernel_address(ptr, byte)) > > >> + if ((unsigned long)ptr < PAGE_SIZE || IS_ERR_VALUE(ptr)) > > >> return "(efault)"; > > "efault" looks a bit like a spellling mistake for "default". It's a special, thus it's in parenthesis, though somebody can be misguided. > > Usually, < PAGE_SIZE means NULL pointer dereference (via the member of a > > struct) > > Maybe the caller should pass in a short buffer so that you can return > "(err-%d)" > or "(null+%#x)" ? In both cases it should be limited to the size of pointer (8 or 16 characters). Something like "(e:%4d)" would work for error codes. The "(null)" is good enough by itself and already an established practice.. -- With Best Regards, Andy Shevchenko