Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6682149yba; Tue, 14 May 2019 11:39:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqzEfcTVIiYoQt2ZViqQN4lEM+QPWGOu93eu4luV6pngD4HGvNbUo5jyEiem9oVm+nH3TKbp X-Received: by 2002:a17:902:e213:: with SMTP id ce19mr40326210plb.30.1557859153462; Tue, 14 May 2019 11:39:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557859153; cv=none; d=google.com; s=arc-20160816; b=ZytsrI03f8bJQYXYIdKRnTgifAxLyrusqUm+3WP+H1mAacyPLHghNehjD0Z7WCVDNg xIhwC7XdvskKECBk6s/xYf836SksJWcpMRJgIhN2hlv/LU4jJcGzKgWGFqywCkwPVoke HXTy7O0rndRyox6KD5O4zxXINqO5dwNJon87y8mSn5GK691eSV1xL8B3Sb0/ZzSB+qvu C4IgOg+7VyzQMLR6laV0Km/bVVpa3NQ3FJiS2Qd83+NOFfvPHLJf0/ZRmwQSqiUBZOn3 qUCcbEUxNFhazMfoCv3Rd+MlhnzvC0bqTJj1FuILuiPBeifA01TEl5yuyxMsmXkUbidA Otiw== 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=8eArLW7JECdSxELNaphentyXbfE7ra/U3Lc9KjXxdNA=; b=nUNbawTTXVWtiCPEY8KQ4VD/Ke7yCIEs4lTwgSSStyQIJoDgPRzTu/tqwskzqS7LEN 4J4y/bLRG/Qf6ODcC+Vo5twwO7twGDoBoO1wrVVmdP6GDAA83uXViAadnk1DN6/PDcI/ AGon8BQQAW5PgAN/7WmQws2VZA6o2Qd0antpyrYqDgUAqLIJm+otqmJFGwrqHkjw1I/B zcEucf9ZFYCbiDnTCwAThtpj0/DL0mlizJrGITqxrEukzbuzN5tyn0TrUuL9bywV2q4H EFMbUlJsDZVyNZ5uVWEfn9+TznXZAMTO7a3NG8Pyc1Ud9724c5CYJNncgYtTPNo3Nfff 67+g== 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 v3si19240925plp.361.2019.05.14.11.38.58; Tue, 14 May 2019 11:39:13 -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 S1727511AbfENShy (ORCPT + 99 others); Tue, 14 May 2019 14:37:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:48392 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726229AbfENShy (ORCPT ); Tue, 14 May 2019 14:37:54 -0400 Received: from oasis.local.home (50-204-120-225-static.hfc.comcastbusiness.net [50.204.120.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 863D8204FD; Tue, 14 May 2019 18:37:52 +0000 (UTC) Date: Tue, 14 May 2019 14:37:51 -0400 From: Steven Rostedt To: Geert Uytterhoeven Cc: David Laight , Sergey Senozhatsky , Petr Mladek , 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: <20190514143751.48e81e05@oasis.local.home> In-Reply-To: References: <20190510081635.GA4533@jagdpanzerIV> <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> 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 [ 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. -- Steve