Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp268021yba; Wed, 15 May 2019 00:37:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzI3XNf8BCuVh686chNnpTKtt2D2c2B+SIrmxlLJafl9WtmN1gZxvpAcwXA38H6MqfrRpg3 X-Received: by 2002:a17:902:3fa5:: with SMTP id a34mr15274852pld.297.1557905845164; Wed, 15 May 2019 00:37:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557905845; cv=none; d=google.com; s=arc-20160816; b=yLCB1+mJ+lBTDFnPXAUG11Z3ZNF9Ou9m3UmxCwtlIKQX5m/WP+fRScHsmEFqVtxA4H mnvdu1fxjs23e4cgofp3yNJaFsHTyV6DRTrMFWKVAumpQW/XzZB45E2iW5B8Hl6wUGO2 zSl5WNFqdBvSj8q5UCeeignHBswPV9Yoz+E1X1ATLjNV9+jgcwzTmi3CaxMApXeT1aF7 bhv9mr8ItkVwwTMnOj5NKCqnCdQbV5eCzwSSabRPH7fBPz4S62f03pbAQSi1IS3i29e0 ddOc5EDS5ivmf6sDJzgMcYTsMSdnMG1fKzEPW60c/tmwl9wXggyxXlu3/0hM08BdsCnJ WNXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=MktdV6vdFywF9e/YAxbKHEVWq6JP0ffuEByCMrN7hgg=; b=rc8gXABpywL9skECqopvqDoNX40M7gtimkW5ctaxl2wg43s3ng+h1vRtRpS7AKrt44 Qh48Y/oy8SQiNsjJOhP28v/V0g27EEUW4z2UjuINn+FzXwkR6CZsDPWjjY+Ttrvq64Bu cMBc+dk52cNRxtVYg1DC/YBJDUPRlnDQhiDi5KgezbgH6Y2YmOmt4ZVKY6zfF/XPoyv5 2IcYNHimWx8psgEia089sXpj05i584pU0wRjCaCFbnxgMg5+PD6srjMqZ57aoKweVXJ5 Xe8EbBM11v0NAyCqqQO2qO1Y6mCHEueha6bqkolIoQs4mIJG+DzseP9MITpMDdUxjQV4 DwOA== 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 r7si1139836ple.418.2019.05.15.00.37.10; Wed, 15 May 2019 00:37:25 -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 S1726260AbfEOHfq (ORCPT + 99 others); Wed, 15 May 2019 03:35:46 -0400 Received: from mx2.suse.de ([195.135.220.15]:54248 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725912AbfEOHfq (ORCPT ); Wed, 15 May 2019 03:35:46 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 8E79AABE9; Wed, 15 May 2019 07:35:44 +0000 (UTC) Date: Wed, 15 May 2019 09:35:42 +0200 From: Petr Mladek To: Steven Rostedt Cc: Geert Uytterhoeven , David Laight , Sergey Senozhatsky , Andy Shevchenko , christophe leroy , Linus Torvalds , Rasmus Villemoes , "Tobin C . Harding" , Michal Hocko , 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: <20190515073542.y6ru2nfagtcrpdl7@pathway.suse.cz> References: <20190510084213.22149-1-pmladek@suse.com> <20190510122401.21a598f6@gandalf.local.home> <096d6c9c17b3484484d9d9d3f3aa3a7c@AcuMS.aculab.com> <20190513091320.GK9224@smile.fi.intel.com> <20190513124220.wty2qbnz4wo52h3x@pathway.suse.cz> <20190514020730.GA651@jagdpanzerIV> <45348cf615fe40d383c1a25688d4a88f@AcuMS.aculab.com> <20190514143751.48e81e05@oasis.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190514143751.48e81e05@oasis.local.home> User-Agent: NeoMutt/20170912 (1.9.0) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 2019-05-14 14:37:51, Steven Rostedt wrote: > > [ Purple is a nice shade on the bike shed. ;-) ] > > On Tue, 14 May 2019 11:02:17 +0200 > Geert Uytterhoeven wrote: > > > On Tue, May 14, 2019 at 10:29 AM David Laight wrote: > > > > And I like Steven's "(fault)" idea. > > > > How about this: > > > > > > > > if ptr < PAGE_SIZE -> "(null)" > > > > if IS_ERR_VALUE(ptr) -> "(fault)" > > > > > > > > -ss > > > > > > Or: > > > if (ptr < PAGE_SIZE) > > > return ptr ? "(null+)" : "(null)"; > > Hmm, that is useful. > > > > if IS_ERR_VALUE(ptr) > > > return "(errno)" > > I still prefer "(fault)" as is pretty much all I would expect from a > pointer dereference, even if it is just bad parsing of, say, a parsing > an MAC address. "fault" is generic enough. "errno" will be confusing, > because that's normally a variable not a output. > > > > > Do we care about the value? "(-E%u)"? > > That too could be confusing. What would (-E22) be considered by a user > doing an sprintf() on some string. I know that would confuse me, or I > would think that it was what the %pX displayed, and wonder why it > displayed it that way. Whereas "(fault)" is quite obvious for any %p > use case. This discussion clearly shows that it is hard to make anyone happy. I considered switching to "(fault)" because there seems to be more people in favor of this. But there is used also "(einval)" when an unsupported pointer modifier is passed. The idea is to show error codes that people are familiar with. It might have been better to use the uppercase "(EFAULT)" and "(EINVAL)" to make it more obvious. But I wanted to follow the existing style with the lowercase "(null)". As of now, I think that we should keep it as is unless there is some wider agreement on a change. Best Regards, Petr