Received: by 10.223.185.116 with SMTP id b49csp5039646wrg; Wed, 7 Mar 2018 05:30:53 -0800 (PST) X-Google-Smtp-Source: AG47ELsvCj5nSUaVFdDd/S3m5Y6K9QCCQV2nCRpNbdDqP++p8+MXdXXGwM52YwHBXY6x+Q3D+a/+ X-Received: by 10.98.64.146 with SMTP id f18mr22817434pfd.30.1520429453416; Wed, 07 Mar 2018 05:30:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520429453; cv=none; d=google.com; s=arc-20160816; b=kciwlX8sWFXePUPBddhEDOAfDbqUhpSemLR7YowLVEhYJjGKR1V9pH9T4RDrePvEJu tho9t9Ii+TsEC5y1Ia0QB30Yb+PCzpHsa+rKqg6gjlmJ1LZHBbOYkYfo4eosl3loXfZg WeIcos0HLGQ3V67ro76yVV7JkoEapPftWD7Hmx9hbIDzGW2e+2a8zNcWcLPJpSNG/MZQ n8aEUr+KV1UjbxvxwVyESHNbzfJTAyjvU6r/Cw2MWN6SxHdODcThCHQf2OpJw494qCAd lVKDU7KGxqtd8UEDt8tn48bJdZCkfQskOlcJVdm+gjEfBjuznM/fRrh583u1qLuk1vRG y9Zg== 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 :organization:references:in-reply-to:date:to:from:subject:message-id :arc-authentication-results; bh=jyWMhbh415fsHDWQK7ALlYrjSj3N5MALWYnyMH/+1CM=; b=dnLAk2l3NL31ZtzMT/btm6vJ31lypV/UXLkf2thUKShtBXwULReYJO4/639aBM8NvI royhNK+qIJxj6B6SVo2p+VUss/4TSbm3/xs7kj9WDJs0wCHQrUJGrQslHvZEqT58HGQQ OOZa3HNF5xJg5d9jHMzVBrlijhZ2RdGRqD6UOZbmCDllczU7SPkyt0Xo8iwjLvegfqWw syJACvspcAstviVJh6IHiRGgyiNTyNP1EH/FQ0R7aGXbPXoBnPXPgPaVJgcSiPU0GV2z 7Poi9WzB9TXK76STyctnwRwxnHDZIHNFup04kMxRFaSiyY/apCdp/pUbmwk7sNmESGUU X62g== 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 b7-v6si13043258plk.592.2018.03.07.05.30.38; Wed, 07 Mar 2018 05:30:53 -0800 (PST) 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 S933445AbeCGN3f (ORCPT + 99 others); Wed, 7 Mar 2018 08:29:35 -0500 Received: from mga11.intel.com ([192.55.52.93]:6033 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933324AbeCGN3e (ORCPT ); Wed, 7 Mar 2018 08:29:34 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Mar 2018 05:29:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,435,1515484800"; d="scan'208";a="23664063" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.86]) by orsmga006.jf.intel.com with ESMTP; 07 Mar 2018 05:29:31 -0800 Message-ID: <1520429370.10722.467.camel@linux.intel.com> Subject: Re: [PATCH 1/2] vsprintf: distinguish between (null), (err) and (invalid) pointer derefs From: Andy Shevchenko To: Adam Borowski , Petr Mladek , Rasmus Villemoes , "Tobin C . Harding" , Joe Perches , linux-kernel@vger.kernel.org, Andrew Morton , Michal Hocko Date: Wed, 07 Mar 2018 15:29:30 +0200 In-Reply-To: <20180306181122.11449-1-kilobyte@angband.pl> References: <20180306092513.ibodfsnv4xrxdlub@pathway.suse.cz> <20180306181122.11449-1-kilobyte@angband.pl> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.5-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2018-03-06 at 19:11 +0100, Adam Borowski wrote: > Attempting to print an object pointed to by a bad (usually ERR_PTR) > pointer > is a not so surprising error. Our code handles them inconsistently: > * two places print (null) if ptr * one place prints (null) if abs(ptr) * one place prints (null) only if !ptr > > Obviously, saying (null) for a small but non-0 value is misleading. > Thus, let's print: > * (null) for exactly 0 > * (err) if last page && abs(ptr)<=MAX_ERRNO > * (invalid) otherwise Ah, and last but not least thing. Where are the test cases? -- Andy Shevchenko Intel Finland Oy