Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1411616pxb; Wed, 10 Feb 2021 07:50:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJzEgCyYYzPRY9E5+UtR+c4w1CQkHZC8HGD7d73hd2kGSDG1EkiBb5YAVCjF7goFt/ztU+C9 X-Received: by 2002:a50:acc1:: with SMTP id x59mr3688611edc.43.1612972203089; Wed, 10 Feb 2021 07:50:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612972203; cv=none; d=google.com; s=arc-20160816; b=WcNYwh6n351nLPZ8uy1UGIUCP93Qa8iJW2nLx9JenHiYVCZU/hFaAqMP1cQumxAC7q v8an68F9FNOu9piZXM46TOiiUFEktQes/CmEViZ5enaxY34QltJXvtCnRpjQgPs58AwB YkkE49kUlELxt0yEszME2lIu995KLYpRdQT1vMUlxgAdW96JWjsTI+RPIx/cXjlSy2/r c96fM0QBcONneFXv78FPXK6vSkul5mCBNOftOi40xQxhMuxRPJi6d8Pw19pqYdWuGRor 5qHB51A5lUJ01CtWtl26FqeDVuQVFNbeDbUhJVHi8v+1OzGKmtAGkPKOobi+NpeCxXBZ tagA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:cc:from :references:to:subject; bh=BviVlrCWIObey+HNxERzgeG1t8DMJTQFIEFFoGI2U28=; b=yjeVTY4QVWwY1DsSFq9nnkvLkZ23vIvzQRqg3MlaQ4ZBGG06FJBWTpcZ7vyVmXbzn/ Dm8XPlUVlkmomcJol4jg57s2f6VFDNzux4Yozg2PTJNoucrtvlAEO1ekg5PRteTBkQSB 6gS2Rf4pK0GUCHGMMu+LyZF6KWv82q2zgtkTY/Wk/PnUUfcLXgrML4gJmlaTP42N+TYc 4qGuTubvz6RoRCCs7dtYjRRs010nm6MFlw3bkgUGk1TUBDz0b4ZIPQAjhzoE7yjizV25 RX9zBMO1vNMLHte5eZq1tP4NVc4TJtBZO9wiq88sBwGpkaRnsBYqX2+l0KHxHYymCW+y igoA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m11si1508716ejc.165.2021.02.10.07.49.38; Wed, 10 Feb 2021 07:50:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231148AbhBJPrK (ORCPT + 99 others); Wed, 10 Feb 2021 10:47:10 -0500 Received: from www262.sakura.ne.jp ([202.181.97.72]:51685 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230048AbhBJPrI (ORCPT ); Wed, 10 Feb 2021 10:47:08 -0500 Received: from fsav104.sakura.ne.jp (fsav104.sakura.ne.jp [27.133.134.231]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 11AFkPLq074787; Thu, 11 Feb 2021 00:46:25 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav104.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav104.sakura.ne.jp); Thu, 11 Feb 2021 00:46:25 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav104.sakura.ne.jp) Received: from [192.168.1.9] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 11AFkKCH074770 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Thu, 11 Feb 2021 00:46:25 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: [PATCH 0/3][RESEND] add support for never printing hashed addresses To: Timur Tabi References: <20210210051814.845713-1-timur@kernel.org> From: Tetsuo Handa Cc: Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Vlastimil Babka , Andy Shevchenko , Matthew Wilcox , akpm@linux-foundation.org, Linus Torvalds , roman.fietze@magna.com, Kees Cook , John Ogness , akinobu.mita@gmail.com, glider@google.com, Andrey Konovalov , Marco Elver , Rasmus Villemoes , Pavel Machek , linux-kernel@vger.kernel.org, linux-mm@kvack.org Message-ID: <6da0be5a-7cb0-4943-e61f-7c3275e60cb6@i-love.sakura.ne.jp> Date: Thu, 11 Feb 2021 00:46:15 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <20210210051814.845713-1-timur@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/02/10 14:18, Timur Tabi wrote: > [accidentally sent from the wrong email address, so resending] > > [The list of email addresses on CC: is getting quite lengthy, > so I hope I've included everyone.] > > Although hashing addresses printed via printk does make the > kernel more secure, it interferes with debugging, especially > with some functions like print_hex_dump() which always uses > hashed addresses. Oh, I was wishing diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 3b53c73580c5..34c7e145ac3c 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -802,7 +802,7 @@ static char *ptr_to_id(char *buf, char *end, const void *ptr, * Print the real pointer value for NULL and error pointers, * as they are not actual addresses. */ - if (IS_ERR_OR_NULL(ptr)) + if (IS_ERR_OR_NULL(ptr) || IS_ENABLED(CONFIG_DEBUG_DONT_HASH_POINTERS)) return pointer_string(buf, end, ptr, spec); /* When debugging early boot use non-cryptographically secure hash. */ change as a kernel config option, for more we try to switch using kernel command line options, more we likely make errors with sharing appropriate kernel command line options (e.g. https://github.com/google/syzkaller/commit/99c64d5c672700d6c0de63d11db25a0678e47a75 ).