Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f33dab0c authored by Manu Gautam's avatar Manu Gautam
Browse files

usb: core: replace %p with %pK



Format specifier %p can leak kernel addresses while not valuing the
kptr_restrict system settings. When kptr_restrict is set to (1), kernel
pointers printed using the %pK format specifier will be replaced with 0's.
Debugging Note : &pK prints only Zeros as address. If you need actual
address information, write 0 to kptr_restrict.

echo 0 > /proc/sys/kernel/kptr_restrict

CRs-fixed: 10528497
Change-Id: Ic2f9a151e3cb186763541dc86cb5b67a7d739ece
Signed-off-by: default avatarManu Gautam <mgautam@codeaurora.org>
parent 984a540d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -373,11 +373,11 @@ static void snoop_urb(struct usb_device *udev,

	if (userurb) {		/* Async */
		if (when == SUBMIT)
			dev_info(&udev->dev, "userurb %p, ep%d %s-%s, "
			dev_info(&udev->dev, "userurb %pK, ep%d %s-%s, "
					"length %u\n",
					userurb, ep, t, d, length);
		else
			dev_info(&udev->dev, "userurb %p, ep%d %s-%s, "
			dev_info(&udev->dev, "userurb %pK, ep%d %s-%s, "
					"actual_length %u status %d\n",
					userurb, ep, t, d, length,
					timeout_or_status);
+2 −2
Original line number Diff line number Diff line
@@ -1643,7 +1643,7 @@ int usb_hcd_unlink_urb (struct urb *urb, int status)
		if (retval == 0)
			retval = -EINPROGRESS;
		else if (retval != -EIDRM && retval != -EBUSY)
			dev_dbg(&udev->dev, "hcd_unlink_urb %p fail %d\n",
			dev_dbg(&udev->dev, "hcd_unlink_urb %pK fail %d\n",
					urb, retval);
		usb_put_dev(udev);
	}
@@ -1812,7 +1812,7 @@ rescan:
		/* kick hcd */
		unlink1(hcd, urb, -ESHUTDOWN);
		dev_dbg (hcd->self.controller,
			"shutdown urb %p ep%d%s%s\n",
			"shutdown urb %pK ep%d%s%s\n",
			urb, usb_endpoint_num(&ep->desc),
			is_in ? "in" : "out",
			({	char *s;
+1 −1
Original line number Diff line number Diff line
@@ -336,7 +336,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
	if (!urb || !urb->complete)
		return -EINVAL;
	if (urb->hcpriv) {
		WARN_ONCE(1, "URB %p submitted while active\n", urb);
		WARN_ONCE(1, "URB %pK submitted while active\n", urb);
		return -EBUSY;
	}

+1 −1
Original line number Diff line number Diff line
@@ -328,7 +328,7 @@ static int queuecommand_lck(struct scsi_cmnd *srb,

	/* check for state-transition errors */
	if (us->srb != NULL) {
		printk(KERN_ERR USB_STORAGE "Error in %s: us->srb = %p\n",
		printk(KERN_ERR USB_STORAGE "Error in %s: us->srb = %pK\n",
			__func__, us->srb);
		return SCSI_MLQUEUE_HOST_BUSY;
	}