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.2 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=unavailable 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 8370FC433DB for ; Fri, 5 Feb 2021 18:29:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2BD3264F06 for ; Fri, 5 Feb 2021 18:29:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233603AbhBEQq2 (ORCPT ); Fri, 5 Feb 2021 11:46:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:45156 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233294AbhBEQnn (ORCPT ); Fri, 5 Feb 2021 11:43:43 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 62B4D64E4D; Fri, 5 Feb 2021 18:25:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612549524; bh=hb309p839a18x47275kXH8RdkKDWYDg5Qa7e2tIfzIU=; h=Subject:To:References:From:Date:In-Reply-To:From; b=PP/2qv0ejvMgDlya0fseiY1tFEzYeNhIgoz2v+eezRT1XWzBYyjXcEICJm8sun0kQ aSi59nceGXXXGoj4w4mG4ZYipqkso3wM8Wpb9AOeGReZI+iP9cz73lozokotMkju6f mkcnrMgEhT9vuowqgW8VHdUByJb+SOMtWCcYTdTu6RSEYHZutHEr2wEaGl63bnkefa cAHibiZPqBznjlN6ge11tK2orMz+XjWsUerZswaMzxDb9+YRMkh9qHfSOzVDQMOjOf Yh8Unu4ucUnxv6cEJ4SleeSrWn1cgwOFVv6mbh2veyyaKljuXo6SI6z4W9oJP8TVKR 0HK075rWG8bkA== Subject: Re: [PATCH][RESEND] lib/vsprintf: make-printk-non-secret printks all addresses as unhashed To: Vlastimil Babka , Petr Mladek , Steven Rostedt , Sergey Senozhatsky , linux-kernel@vger.kernel.org, linux-mm@kvack.org, willy@infradead.org, akpm@linux-foundation.org, torvalds@linux-foundation.org, roman.fietze@magna.com, keescook@chromium.org, john.ogness@linutronix.de, akinobu.mita@gmail.com References: <20210202213633.755469-1-timur@kernel.org> <3baace45-38af-a59b-c376-9a4c39a17b2d@suse.cz> From: Timur Tabi Message-ID: Date: Fri, 5 Feb 2021 12:25:22 -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: <3baace45-38af-a59b-c376-9a4c39a17b2d@suse.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/5/21 4:59 AM, Vlastimil Babka wrote: > Thanks a lot. Should this also affect %pK though? IIUC, there's currently no way > to achieve non-mangled %pK in all cases, even with the most permissive > kptr_restrict=1 setting: > - in IRQ, there's "pK-error" instead > - in a context of non-CAP_SYSLOG process, nulls are printed Hmmm.. I thought %pK prints an unhashed pointer when the user is root, at least in situations where the user can be known (e.g. during an ioctl call). > Yes, neither should matter if %pK were only used for prints that generate > content of some kind of /proc file read by a CAP_SYSLOG process, but that > doesn't seem to be the case and there are %pK used for printing to dmesg too... I thought about that. On one hand, people who use %pK probably really wanted a hashed pointer printed. On the other hand, I agree that %pK should not be used for dmesg prints. I get the feeling that some (most?) people who use %pK don't really understand how it's supposed to be used. I can extend make-printk-non-secret to %pK if everyone agrees.