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=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 45D9AC2D0E4 for ; Fri, 20 Nov 2020 16:44:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D79502078B for ; Fri, 20 Nov 2020 16:44:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729140AbgKTQoN (ORCPT ); Fri, 20 Nov 2020 11:44:13 -0500 Received: from netrider.rowland.org ([192.131.102.5]:34519 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726426AbgKTQoN (ORCPT ); Fri, 20 Nov 2020 11:44:13 -0500 Received: (qmail 621340 invoked by uid 1000); 20 Nov 2020 11:44:12 -0500 Date: Fri, 20 Nov 2020 11:44:12 -0500 From: Alan Stern To: Petr Mladek , Steven Rostedt , Sergey Senozhatsky Cc: Kernel development list Subject: Printk specifiers for __user pointers Message-ID: <20201120164412.GD619708@rowland.harvard.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To the VSPRINTF maintainers: Documentation/core-api/printk-formats.rst lists a large number of format specifiers for pointers of various sorts. Yet as far as I can see, there is no specifier meant for use with __user pointers. The security implications of printing the true, unmangled value of a __user pointer are minimal, since doing so does not leak any kernel information. So %px would work, but tools like checkpatch.pl don't like it. Should a new specifier be added? If not, should we simply use %px? Alan Stern