Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1491893pxb; Fri, 20 Nov 2020 10:46:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJwhwALV/7poSezHVerSY14mjjWAN/6tpfqx/lx1TeBTXPzuFocymWjrjqiyytuYtUtjHzp1 X-Received: by 2002:a17:906:2581:: with SMTP id m1mr33244790ejb.28.1605897977810; Fri, 20 Nov 2020 10:46:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605897977; cv=none; d=google.com; s=arc-20160816; b=R3CUXNG82iMOPokluW1zVs3MEwUWkl8oSeziUgAupMLK3Smkb8WQFhxGdgPUKob3g9 F8Ax2zA0/tF5SSNSRR/bVh1eWxojaTgqlVEUy67DrChZd9fLGqlupHXvTYYM0IRhLJHh UcMS6SIgIbeF+xA4vOgprO8EnZ+ETQQe00Vajh7TyreY1WUiL37lvreeDS60bUcjzP9Z e1McclVeCaFoQ2PA7uYG+iOavPwFFU5x/w4J2VLT+BhKP5p3IDoudtxyzfwoHbh9Dmp8 1NcGwKLFds9+f+V2/Fenvc8lrzUwVf490M+hWrakilFfUhtY9VSLCdpjC0l88UeRr7nY 9cxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=gzVgOmGYZ2x5DIEK3OTyeUVmBIDfKN8K6im1AJ1CCfc=; b=Vc+H/Pip4Gq4eR1k7+h/+Oisv+1nCAFtrCN519MbzTU60VEuQRSu4WAeg3HDvQtJxP 3LlCi+o4DTKeqDHBD91gpbpaqUn0RdPkw5dxOvuPKxE3dzhOqO6AUzPhov8zS2MGc6NO SAxhHV/+E0cozR9zYikw0hDVTzVntyqWVLstH8279SH0UbBn7/FSDUV76Mt5GrJrG5Z2 jICXAAkeeqt87EDZ7tNxtZ05YqQ+vDKjL3svNtYqiICYwJz10DPw9PCDhNVLYxccuJkq +2orGMRXzUP7KfcBwSgb6R9eX0NDQYvh4rRRxeaMii+TesqT4nd4C8eolLJdZrbRxjIl d/uw== 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 p13si2142929ejx.702.2020.11.20.10.45.55; Fri, 20 Nov 2020 10:46:17 -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 S1731582AbgKTSmp (ORCPT + 99 others); Fri, 20 Nov 2020 13:42:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:60002 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731491AbgKTSmo (ORCPT ); Fri, 20 Nov 2020 13:42:44 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EEFDE21D91; Fri, 20 Nov 2020 18:42:43 +0000 (UTC) Date: Fri, 20 Nov 2020 13:42:42 -0500 From: Steven Rostedt To: Alan Stern Cc: Petr Mladek , Sergey Senozhatsky , Kernel development list Subject: Re: Printk specifiers for __user pointers Message-ID: <20201120134242.6cae9e72@gandalf.local.home> In-Reply-To: <20201120164412.GD619708@rowland.harvard.edu> References: <20201120164412.GD619708@rowland.harvard.edu> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 20 Nov 2020 11:44:12 -0500 Alan Stern wrote: > 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? There's currently no user of '%pu' (although there is a '%pus'. Perhaps we should have a '%pux'? I would even state that if it is used, that if makes sure that the value is indeed a user space pointer (goes through the same checks as accessing user space), before its printed, otherwise it shows "(fault)" or something. -- Steve