aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/serial
diff options
context:
space:
mode:
authorManu Gautam <mgautam@codeaurora.org>2017-02-24 15:22:40 +0530
committerMoyster <oysterized@gmail.com>2018-11-27 16:09:55 +0100
commit513cef2c53c2b3846f6c571823412f514b6f66c7 (patch)
tree91c79e2c53b67916729fbfea3150bf7d9571bbdc /drivers/usb/serial
parentb32e2d51665e3b6af648dec474db214b6312d967 (diff)
usb: 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: 1052849 Change-Id: I0e98145730380ea983fa8f46a28d15dd6c2c31df Signed-off-by: Manu Gautam <mgautam@codeaurora.org> Signed-off-by: Yasir Malik <ymalik@codeaurora.org> Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r--drivers/usb/serial/ch341.c2
-rw-r--r--drivers/usb/serial/garmin_gps.c2
-rw-r--r--drivers/usb/serial/io_edgeport.c4
-rw-r--r--drivers/usb/serial/keyspan.c2
-rw-r--r--drivers/usb/serial/mos7720.c2
-rw-r--r--drivers/usb/serial/option.c2
-rw-r--r--drivers/usb/serial/sierra.c6
-rw-r--r--drivers/usb/serial/usb_wwan.c2
8 files changed, 11 insertions, 11 deletions
diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c
index a4e5be5ae..9dc3c0f80 100644
--- a/drivers/usb/serial/ch341.c
+++ b/drivers/usb/serial/ch341.c
@@ -109,7 +109,7 @@ static int ch341_control_in(struct usb_device *dev,
{
int r;
- dev_dbg(&dev->dev, "ch341_control_in(%02x,%02x,%04x,%04x,%p,%u)\n",
+ dev_dbg(&dev->dev, "ch341_control_in(%02x,%02x,%04x,%04x,%pK,%u)\n",
USB_DIR_IN|0x40, (int)request, (int)value, (int)index, buf,
(int)bufsize);
diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c
index ea9c4f4ae..bc431126b 100644
--- a/drivers/usb/serial/garmin_gps.c
+++ b/drivers/usb/serial/garmin_gps.c
@@ -415,7 +415,7 @@ static int gsp_rec_packet(struct garmin_data *garmin_data_p, int count)
/* sanity check, remove after test ... */
if ((__u8 *)&(usbdata[3]) != recpkt) {
- dev_dbg(dev, "%s - ptr mismatch %p - %p\n", __func__,
+ dev_dbg(dev, "%s - ptr mismatch %pK - %pK\n", __func__,
&(usbdata[4]), recpkt);
return -EINVPKT;
}
diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c
index 9f24fd776..1043a61f9 100644
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -759,7 +759,7 @@ static void edge_bulk_out_cmd_callback(struct urb *urb)
int status = urb->status;
atomic_dec(&CmdUrbs);
- dev_dbg(&urb->dev->dev, "%s - FREE URB %p (outstanding %d)\n",
+ dev_dbg(&urb->dev->dev, "%s - FREE URB %pK (outstanding %d)\n",
__func__, urb, atomic_read(&CmdUrbs));
@@ -2216,7 +2216,7 @@ static int write_cmd_usb(struct edgeport_port *edge_port,
return -ENOMEM;
atomic_inc(&CmdUrbs);
- dev_dbg(dev, "%s - ALLOCATE URB %p (outstanding %d)\n",
+ dev_dbg(dev, "%s - ALLOCATE URB %pK (outstanding %d)\n",
__func__, urb, atomic_read(&CmdUrbs));
usb_fill_bulk_urb(urb, edge_serial->serial->dev,
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c
index 32a67c69e..034889170 100644
--- a/drivers/usb/serial/keyspan.c
+++ b/drivers/usb/serial/keyspan.c
@@ -1296,7 +1296,7 @@ static struct urb *keyspan_setup_urb(struct usb_serial *serial, int endpoint,
return NULL;
}
- dev_dbg(&serial->interface->dev, "%s - using urb %p for %s endpoint %x\n",
+ dev_dbg(&serial->interface->dev, "%s - using urb %pK for %s endpoint %x\n",
__func__, urb, ep_type_name, endpoint);
return urb;
}
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
index 2d1ad823b..76808474d 100644
--- a/drivers/usb/serial/mos7720.c
+++ b/drivers/usb/serial/mos7720.c
@@ -1036,7 +1036,7 @@ static int mos7720_open(struct tty_struct *tty, struct usb_serial_port *port)
port_number = port->number - port->serial->minor;
read_mos_reg(serial, port_number, LSR, &data);
- dev_dbg(&port->dev, "SS::%p LSR:%x\n", mos7720_port, data);
+ dev_dbg(&port->dev, "SS::%pK LSR:%x\n", mos7720_port, data);
write_mos_reg(serial, dummy, SP1_REG, 0x02);
write_mos_reg(serial, dummy, SP2_REG, 0x02);
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index f9e43048e..8971f133f 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -2013,7 +2013,7 @@ static void option_instat_callback(struct urb *urb)
struct usb_wwan_port_private *portdata =
usb_get_serial_port_data(port);
- dev_dbg(dev, "%s: urb %p port %p has data %p\n", __func__, urb, port, portdata);
+ dev_dbg(dev, "%s: urb %pK port %pK has data %pK\n", __func__, urb, port, portdata);
if (status == 0) {
struct usb_ctrlrequest *req_pkt =
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index af9f82a1f..b12778741 100644
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -616,7 +616,7 @@ static void sierra_instat_callback(struct urb *urb)
struct sierra_port_private *portdata = usb_get_serial_port_data(port);
struct usb_serial *serial = port->serial;
- dev_dbg(&port->dev, "%s: urb %p port %p has data %p\n", __func__,
+ dev_dbg(&port->dev, "%s: urb %pK port %pK has data %pK\n", __func__,
urb, port, portdata);
if (status == 0) {
@@ -755,10 +755,10 @@ static struct urb *sierra_setup_urb(struct usb_serial *serial, int endpoint,
usb_sndbulkpipe(serial->dev, endpoint) | dir,
buf, len, callback, ctx);
- dev_dbg(&serial->dev->dev, "%s %c u : %p d:%p\n", __func__,
+ dev_dbg(&serial->dev->dev, "%s %c u : %pK d:%pK\n", __func__,
dir == USB_DIR_IN ? 'i' : 'o', urb, buf);
} else {
- dev_dbg(&serial->dev->dev, "%s %c u:%p d:%p\n", __func__,
+ dev_dbg(&serial->dev->dev, "%s %c u:%pK d:%pK\n", __func__,
dir == USB_DIR_IN ? 'i' : 'o', urb, buf);
sierra_release_urb(urb);
diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c
index 36f6b6a56..541c2dd92 100644
--- a/drivers/usb/serial/usb_wwan.c
+++ b/drivers/usb/serial/usb_wwan.c
@@ -247,7 +247,7 @@ int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port,
err = usb_submit_urb(this_urb, GFP_ATOMIC);
if (err) {
dev_dbg(&port->dev,
- "usb_submit_urb %p (write bulk) failed (%d)\n",
+ "usb_submit_urb %pK (write bulk) failed (%d)\n",
this_urb, err);
clear_bit(i, &portdata->out_busy);
spin_lock_irqsave(&intfdata->susp_lock, flags);