From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14D8CC433E0 for ; Wed, 10 Feb 2021 17:27:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 981DA64E7C for ; Wed, 10 Feb 2021 17:27:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 981DA64E7C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E40136B0006; Wed, 10 Feb 2021 12:27:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DC70A6B006E; Wed, 10 Feb 2021 12:27:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CB6B56B0071; Wed, 10 Feb 2021 12:27:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0030.hostedemail.com [216.40.44.30]) by kanga.kvack.org (Postfix) with ESMTP id B30126B0006 for ; Wed, 10 Feb 2021 12:27:51 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 801CCDDFD for ; Wed, 10 Feb 2021 17:27:51 +0000 (UTC) X-FDA: 77803040742.19.title13_4c03f2827611 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id 5EFC81ACC35 for ; Wed, 10 Feb 2021 17:27:51 +0000 (UTC) X-HE-Tag: title13_4c03f2827611 X-Filterd-Recvd-Size: 3537 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Wed, 10 Feb 2021 17:27:50 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 70FA764E77; Wed, 10 Feb 2021 17:27:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612978070; bh=idCIC6KkKWnS8zqMzwGmRPIjOPqsJEjt8EXLdQqg03Y=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=K43DgBzYwjHUq+RQv45uKHMAkGBTS9sQqMOudLcBbIwAx/+0/1aaS1vFpIA4G3Czq qhRx8ZNNITd7QlL6Yh7Ylkm9/tb6FqBaF7udNOpA9BGDCn+sOwl/RR8rAazwEXwR4g l12UehSBtx6m8I5SRVu01ofvVeS8WEKT/6MizuCZWQsZnDKjFsHKak4ieKOggb5gx2 a7A+08GPdL6OFPc7UKhh6gDIeyrlg+s5lJwZjENqK14oc9RgSlzLztwOjm1tbNfT3C NOaSogVRTiz4W6IYvEIDQWf0Qs8gQ/iyzbf6SunsQxHQx6oqK9tTuCEsifVd3qBdqn zXj5iBtf/4DAA== Subject: Re: [PATCH 3/3] lib/vsprintf: make-printk-non-secret printks all addresses as unhashed To: Petr Mladek Cc: 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 References: <20210210051814.845713-1-timur@kernel.org> <20210210051814.845713-4-timur@kernel.org> From: Timur Tabi Message-ID: Date: Wed, 10 Feb 2021 11:27:45 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 2/10/21 7:41 AM, Petr Mladek wrote: > > The option causes that vsprintf() will not hash pointers. Yes, it is > primary used by printk(). But it is used also in some other > interfaces, especially trace_printk(), seq_buf() API. The naked > pointers might appear more or less anywhere, including procfs, > sysfs, debugfs. Fair point. Shouldn't calls to seq_buf_printf() (and any printk usage that always exists in the context of a user-space process) use %pK anyway? Hmmm.... maybe vsprintf() should automatically replace %p with %pK if it detects a user-space context? > IMHO, we should fix this. The long discussion was about how to make > this option safe. Users should be aware that it is not only about > the kernel log. Agreed. > I suggest to rename the parameter "debug_never_hash_pointer" and use > the same name for the parameter and the variable. Will do. > We also should make the warning more generic. I suggest to replace the > first paragraph with something like: > > pr_warn("** The hashing of printed pointers has been disabled **\n"); > pr_warn("** for debugging purposes. **\n"); > > Feel free to use a better wording. I am not a native speaker. You could have fooled me. > Of course, also kernel-parameters.txt has to be updated accordingly. Ok.