From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: David Laight Subject: RE: [PATCH] vsprintf: Do not break early boot with probing addresses Date: Tue, 14 May 2019 08:28:21 +0000 Message-ID: <45348cf615fe40d383c1a25688d4a88f@AcuMS.aculab.com> 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> In-Reply-To: <20190514020730.GA651@jagdpanzerIV> Content-Language: en-US MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-arch-owner@vger.kernel.org Message-ID: <20190514082821.vHA7v2O08oEYQIonTCUC1XbIM9aVA42znGjzYx0yqEA@z> List-Archive: List-Post: To: 'Sergey Senozhatsky' , Petr Mladek Cc: Andy Shevchenko , 'christophe leroy' , Steven Rostedt , 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 List-ID: > 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)"; if IS_ERR_VALUE(ptr) return "(errno)" David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)