Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp403571pxu; Tue, 1 Dec 2020 14:23:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJweUbCzZ7nIgCfj6WqIJeljcZPxp+Cwt42t89vEVgb6Sr3EaaNGkIdxlWSar+0e7NMfXgwE X-Received: by 2002:aa7:c303:: with SMTP id l3mr5310144edq.2.1606861398846; Tue, 01 Dec 2020 14:23:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606861398; cv=none; d=google.com; s=arc-20160816; b=xmb4lNyeLtsoiKF2rlu/QY/8chIRMh+XBrU0JaXoCjSBjLPdW96I77Zr4HRvBC/LOH INefBfr2mdE1ovhqQ+4N5L8aYhTZReuKWqARDjNmUJwDPrgiMQY0Gcolok2WXBXrHmMj Niun3YNdVa2oyK7LpRlCe8GfHhCMhrxu4SpETNuG+jOkIDfGFIVsxUyp5+fvX89SikQl OKYCUZWuO0lSQrdK7tdX+gVMqQXaKW9U/5MFN50GZQCWt79M+ly2rxgH5yd9/dUlDCQ6 wCiI9a/ocqkNEhmvebcGUuGTPWPxbN8eMQ5A27kzZ+tHOLlz1ZRy552CqniMzSyHqJ9w oGDQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=b+nuKbH0l8e9BJpAOexe+QroCmnhIaSDrOEi3Q1gUnk=; b=j2byDeUgQXu3rthZyOTQd3zgvsnY6FgUb1N40Z7Ww/XmOK8l3aVZ9cRvnqaNlttRBv /Ke4WSan4OWTZ1umz/OhpPU/RmdxCbsbxeT3AQeMaf2GFLV86hTsFFx5Pd2lwoHVu/XR tpeIi4s0Q6ePBTulxAeUMgjG/KAG0ZkjQ1aUe0PkIL///itQ9RWn5FT8nJ4PoAcGuRMA xy5JBQXH3zZefejWE35n3K5NPGRjo0RySM7gL6UaXOJtzt543rPdGOuCA3iHS6jaBa4R wiymjQmnHyEyZhzGfn78r0tscNtpjvwW44t4uw6hOAInBrHwdLdGKCli56DhMzAa3A4s zYUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rOPdBclB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s6si798916ejb.276.2020.12.01.14.22.56; Tue, 01 Dec 2020 14:23:18 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rOPdBclB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388585AbgLAJIL (ORCPT + 99 others); Tue, 1 Dec 2020 04:08:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:42876 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388785AbgLAJGX (ORCPT ); Tue, 1 Dec 2020 04:06:23 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 F235E20770; Tue, 1 Dec 2020 09:06:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606813561; bh=dQbtmU+u4tSmTn8ENNQn8j9gALkgWiE238aS/UrT8r0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rOPdBclBhk0yasdG9yoh2mpXBlOIK+k/Pq6xzEPrvQR5MPHwpU7kH52RI/X8hmCMO 46ud7FCxs9Mcn36nKhFXpxpDaMUWfJji2BNr5QKpAatklfBpJ1dYyIrltKaQUSrQxG fV5LBeRM2TO0t3e+12OmGYAs4VCfLMhSFla8hQI0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vamsi Krishna Samavedam , Alan Stern Subject: [PATCH 5.4 81/98] USB: core: Change %pK for __user pointers to %px Date: Tue, 1 Dec 2020 09:53:58 +0100 Message-Id: <20201201084659.018694387@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201201084652.827177826@linuxfoundation.org> References: <20201201084652.827177826@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alan Stern commit f3bc432aa8a7a2bfe9ebb432502be5c5d979d7fe upstream. Commit 2f964780c03b ("USB: core: replace %p with %pK") used the %pK format specifier for a bunch of __user pointers. But as the 'K' in the specifier indicates, it is meant for kernel pointers. The reason for the %pK specifier is to avoid leaks of kernel addresses, but when the pointer is to an address in userspace the security implications are minimal. In particular, no kernel information is leaked. This patch changes the __user %pK specifiers (used in a bunch of debugging output lines) to %px, which will always print the actual address with no mangling. (Notably, there is no printk format specifier particularly intended for __user pointers.) Fixes: 2f964780c03b ("USB: core: replace %p with %pK") CC: Vamsi Krishna Samavedam CC: Signed-off-by: Alan Stern Link: https://lore.kernel.org/r/20201119170228.GB576844@rowland.harvard.edu Signed-off-by: Greg Kroah-Hartman --- drivers/usb/core/devio.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -482,11 +482,11 @@ static void snoop_urb(struct usb_device if (userurb) { /* Async */ if (when == SUBMIT) - dev_info(&udev->dev, "userurb %pK, ep%d %s-%s, " + dev_info(&udev->dev, "userurb %px, ep%d %s-%s, " "length %u\n", userurb, ep, t, d, length); else - dev_info(&udev->dev, "userurb %pK, ep%d %s-%s, " + dev_info(&udev->dev, "userurb %px, ep%d %s-%s, " "actual_length %u status %d\n", userurb, ep, t, d, length, timeout_or_status); @@ -1992,7 +1992,7 @@ static int proc_reapurb(struct usb_dev_s if (as) { int retval; - snoop(&ps->dev->dev, "reap %pK\n", as->userurb); + snoop(&ps->dev->dev, "reap %px\n", as->userurb); retval = processcompl(as, (void __user * __user *)arg); free_async(as); return retval; @@ -2009,7 +2009,7 @@ static int proc_reapurbnonblock(struct u as = async_getcompleted(ps); if (as) { - snoop(&ps->dev->dev, "reap %pK\n", as->userurb); + snoop(&ps->dev->dev, "reap %px\n", as->userurb); retval = processcompl(as, (void __user * __user *)arg); free_async(as); } else { @@ -2139,7 +2139,7 @@ static int proc_reapurb_compat(struct us if (as) { int retval; - snoop(&ps->dev->dev, "reap %pK\n", as->userurb); + snoop(&ps->dev->dev, "reap %px\n", as->userurb); retval = processcompl_compat(as, (void __user * __user *)arg); free_async(as); return retval; @@ -2156,7 +2156,7 @@ static int proc_reapurbnonblock_compat(s as = async_getcompleted(ps); if (as) { - snoop(&ps->dev->dev, "reap %pK\n", as->userurb); + snoop(&ps->dev->dev, "reap %px\n", as->userurb); retval = processcompl_compat(as, (void __user * __user *)arg); free_async(as); } else { @@ -2621,7 +2621,7 @@ static long usbdev_do_ioctl(struct file #endif case USBDEVFS_DISCARDURB: - snoop(&dev->dev, "%s: DISCARDURB %pK\n", __func__, p); + snoop(&dev->dev, "%s: DISCARDURB %px\n", __func__, p); ret = proc_unlinkurb(ps, p); break;