Received: by 10.223.176.5 with SMTP id f5csp970093wra; Tue, 6 Feb 2018 10:16:58 -0800 (PST) X-Google-Smtp-Source: AH8x227WaItPBWmQIRW9uCg8m7StUEexTUIxV8gW8dfte9FywUmljARNg+GPJeDv2fchHGptfjaj X-Received: by 10.99.44.209 with SMTP id s200mr2610613pgs.407.1517941018846; Tue, 06 Feb 2018 10:16:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517941018; cv=none; d=google.com; s=arc-20160816; b=JoIIRTiynm3Z9vUYBDvEeXHCmz/mSk6iOfm+BJNglD0zK/vAHevhtM+vZFio+pl0nM 7WqLbm1Szy/gvH2gb9F3z5zN3UQv2yEekqRNHFXNGnDyXE2P+NBeQ3xrQYvXfljQLrgM /Y3MdjqW3FmOSMohQ/dGk9kh7D2JmCcu7YVAf+8GXitBQfsj+/85xt8CxGhMKDM4YbVG Zp7RYMLlJrGnUeZfghS5Jo9SyVFVUDlmsh2L9JSErgKt5IP8e//sqakWLkDhnYQFKVkw mv0SCLQhwyiiYwAKq09878CTZPl86P3jtyA1p8cUYxWBVImenhGZXQs9ZvVwPhq6CRHl o+gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:arc-authentication-results; bh=1xfMv9Wi25X6U/+bfQ13VoLC6gPAF+X2yJndZf7GVGA=; b=EmYdASLW7oqWIvETArYEILGDwd/DQP26B+zvavIcLJEQDFC96N3WI8Xf2YaZH1ajXY P0HxWcjUsMRrCjDhdjBfVjhSXHLGy7vbvSRto3beedlxmG4tj6cSgL3GfP1D4I20FeK2 pvvoIGGYPT3S/heFwHoBpGvASSUpWuTW6iy6uaaXn057gtqLpco6TtiaVIw1zR+QZs64 pnQB1lMLL/V68KRiRM0ytTL9SlMLV2kfFR9RyXok0tcVGkmqnRFF7wogI5Uhnm5Bze9d 6nuhiR2rBEf9LZaA7n+feWKJ6AbTlG44pTYxIm4orMObzzmKj48WJatG7iDdiZDCB3X1 hUcA== 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 n7si270876pgt.592.2018.02.06.10.16.44; Tue, 06 Feb 2018 10:16:58 -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 S1753000AbeBFSON convert rfc822-to-8bit (ORCPT + 99 others); Tue, 6 Feb 2018 13:14:13 -0500 Received: from mga11.intel.com ([192.55.52.93]:36506 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752939AbeBFSOF (ORCPT ); Tue, 6 Feb 2018 13:14:05 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Feb 2018 10:14:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,469,1511856000"; d="scan'208";a="25171707" Received: from orsmsx103.amr.corp.intel.com ([10.22.225.130]) by orsmga003.jf.intel.com with ESMTP; 06 Feb 2018 10:14:05 -0800 Received: from orsmsx111.amr.corp.intel.com (10.22.240.12) by ORSMSX103.amr.corp.intel.com (10.22.225.130) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 6 Feb 2018 10:14:05 -0800 Received: from orsmsx101.amr.corp.intel.com ([169.254.8.72]) by ORSMSX111.amr.corp.intel.com ([169.254.12.253]) with mapi id 14.03.0319.002; Tue, 6 Feb 2018 10:14:04 -0800 From: "Roberts, William C" To: "Tobin C. Harding" , Adam Borowski CC: Kees Cook , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , LKML , Andrew Morton , Joe Perches , Linus Torvalds , David Laight , Randy Dunlap , Geert Uytterhoeven Subject: RE: [PATCH] vsprintf: avoid misleading "(null)" for %px Thread-Topic: [PATCH] vsprintf: avoid misleading "(null)" for %px Thread-Index: AQHTnmX59IqJrZAbVU+vhhhRB6pEZqOWr5mAgAAV+ICAAASkAIAABzKAgAAXpACAAMaZAA== Date: Tue, 6 Feb 2018 18:14:03 +0000 Message-ID: <476DC76E7D1DF2438D32BFADF679FC563FEE795E@ORSMSX101.amr.corp.intel.com> References: <20180204174521.21383-1-kilobyte@angband.pl> <20180205094438.pfd7ffymlvklpxe7@pathway.suse.cz> <20180205201555.GQ29988@eros> <20180205205817.72dy7e7xzjcnwmhs@angband.pl> <20180205222254.GS29988@eros> In-Reply-To: <20180205222254.GS29988@eros> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.22.254.140] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Tobin C. Harding [mailto:me@tobin.cc] > Sent: Monday, February 5, 2018 2:23 PM > To: Adam Borowski > Cc: Kees Cook ; Petr Mladek ; > Sergey Senozhatsky ; Steven Rostedt > ; LKML ; Andrew Morton > ; Joe Perches ; Roberts, > William C ; Linus Torvalds foundation.org>; David Laight ; Randy Dunlap > ; Geert Uytterhoeven > Subject: Re: [PATCH] vsprintf: avoid misleading "(null)" for %px > > On Mon, Feb 05, 2018 at 09:58:17PM +0100, Adam Borowski wrote: > > On Tue, Feb 06, 2018 at 07:32:32AM +1100, Kees Cook wrote: > > > On Tue, Feb 6, 2018 at 7:15 AM, Tobin C. Harding wrote: > > > > On Tue, Feb 06, 2018 at 05:57:17AM +1100, Kees Cook wrote: > > > >> On Mon, Feb 5, 2018 at 8:44 PM, Petr Mladek > wrote: > > > >> > On Sun 2018-02-04 18:45:21, Adam Borowski wrote: > > > >> >> Like %pK already does, print "00000000" instead. > > > >> >> > > > >> >> This confused people -- the convention is that "(null)" means > > > >> >> you tried to dereference a null pointer as opposed to printing the > address. > > > > > > > > Leaving aside what is converting to %px. If we consider that > > > > using %px is meant to convey to us that we _really_ want the > > > > address, in hex hence the 'x', then it is not surprising that we > > > > will get "00000000"'s for a null pointer, right? Yes it is > > > > different to before but since we are changing the specifier does > > > > this not imply that there may be some change? > > > > > > I personally prefer 0000s, but if we're going to change this, we > > > need to be aware of the difference. > > > > It's easy to paint this bikeshed any color you guys want to: there's an "if" > > already. My preference is also 0000; NULL would be good, too -- I > > just don't want (null) as that has a special meaning in usual > > userspace implementations; (null) also fits well most other modes of > > %p as they show some object the argument points to. Confusion = wasted > debugging time. > > > > This is consistent with what we had before, with %pK special-cased. > > > > > > In what is now to be expected fashion for %p the discussion > > > > appears to have split into two different things - what to do with > > > > %px and what to do with %pK :) > > > > > > I say leave %pK alone. :) > > > > As in, printing some random (hashed) value? > > > > > > Let's recap: > > > > Currently: > > not-null null > > %pponies object's description (null) > > %px address (null) > > %pK hash hash > > > > I'd propose: > > not-null null > > %pponies object's description (null) > > %px address 00000000 > > %pK hash 00000000 > > > > The initial patch in this thread changes printk("%px",0) from (null) > > to 00000000; what Tobin complained about is that printk("%pK",0) prints a > > random value. > > Epic fail on my behalf, my first comment was _wrong_ and brought %pK into the > discussion - bad Tobin, please crawl back under your rock. > > The original patch is good IMO and I AFAICT in everyone else's. Nod. > > Tobin