diff options
| author | Vamsi Krishna Samavedam <vskrishn@codeaurora.org> | 2016-11-03 17:21:02 -0700 |
|---|---|---|
| committer | Hemant Kumar <hemantk@codeaurora.org> | 2017-01-05 12:01:53 -0800 |
| commit | f96c1912ec1119c2f38264c4e10129988ac0baf6 (patch) | |
| tree | 5a940ea52bca1a054146eb8e01274008cfd34e1b | |
| parent | 16386af38ac53777fa1a249d9f03404b226fb5ac (diff) | |
sound: 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
Change-Id: Iaf20ac2175295dee8745c48f8c208a78b84dea91
Signed-off-by: Vamsi Krishna Samavedam <vskrishn@codeaurora.org>
| -rw-r--r-- | sound/usb/endpoint.c | 4 | ||||
| -rw-r--r-- | sound/usb/pcm.c | 12 | ||||
| -rw-r--r-- | sound/usb/usb_audio_qmi_svc.c | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index c07a7eda42a2..252dd6df5ef1 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c @@ -357,7 +357,7 @@ static void queue_pending_output_urbs(struct snd_usb_endpoint *ep) err = usb_submit_urb(ctx->urb, GFP_ATOMIC); if (err < 0) usb_audio_err(ep->chip, - "Unable to submit urb #%d: %d (urb %p)\n", + "Unable to submit urb #%d: %d (urb %pK)\n", ctx->index, err, ctx->urb); else set_bit(ctx->index, &ep->active_mask); @@ -459,7 +459,7 @@ struct snd_usb_endpoint *snd_usb_add_endpoint(struct snd_usb_audio *chip, ep->iface == alts->desc.bInterfaceNumber && ep->altsetting == alts->desc.bAlternateSetting) { usb_audio_dbg(ep->chip, - "Re-using EP %x in iface %d,%d @%p\n", + "Re-using EP %x in iface %d,%d @%pK\n", ep_num, ep->iface, ep->altsetting, ep); goto __exit_unlock; } diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index ae8f8660a18d..a0c0a184d02b 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c @@ -228,7 +228,7 @@ static int start_endpoints(struct snd_usb_substream *subs, bool can_sleep) if (!test_and_set_bit(SUBSTREAM_FLAG_DATA_EP_STARTED, &subs->flags)) { struct snd_usb_endpoint *ep = subs->data_endpoint; - dev_dbg(&subs->dev->dev, "Starting data EP @%p\n", ep); + dev_dbg(&subs->dev->dev, "Starting data EP @%pK\n", ep); ep->data_subs = subs; err = snd_usb_endpoint_start(ep, can_sleep); @@ -257,7 +257,7 @@ static int start_endpoints(struct snd_usb_substream *subs, bool can_sleep) } } - dev_dbg(&subs->dev->dev, "Starting sync EP @%p\n", ep); + dev_dbg(&subs->dev->dev, "Starting sync EP @%pK\n", ep); ep->sync_slave = subs->data_endpoint; err = snd_usb_endpoint_start(ep, can_sleep); @@ -629,13 +629,13 @@ static int match_endpoint_audioformats(struct snd_usb_substream *subs, if (fp->channels < 1) { dev_dbg(&subs->dev->dev, - "%s: (fmt @%p) no channels\n", __func__, fp); + "%s: (fmt @%pK) no channels\n", __func__, fp); return 0; } if (!(fp->formats & pcm_format_to_bits(pcm_format))) { dev_dbg(&subs->dev->dev, - "%s: (fmt @%p) no match for format %d\n", __func__, + "%s: (fmt @%pK) no match for format %d\n", __func__, fp, pcm_format); return 0; } @@ -648,7 +648,7 @@ static int match_endpoint_audioformats(struct snd_usb_substream *subs, } if (!score) { dev_dbg(&subs->dev->dev, - "%s: (fmt @%p) no match for rate %d\n", __func__, + "%s: (fmt @%pK) no match for rate %d\n", __func__, fp, rate); return 0; } @@ -657,7 +657,7 @@ static int match_endpoint_audioformats(struct snd_usb_substream *subs, score++; dev_dbg(&subs->dev->dev, - "%s: (fmt @%p) score %d\n", __func__, fp, score); + "%s: (fmt @%pK) score %d\n", __func__, fp, score); return score; } diff --git a/sound/usb/usb_audio_qmi_svc.c b/sound/usb/usb_audio_qmi_svc.c index 2cdf4901b8c7..039519c1d822 100644 --- a/sound/usb/usb_audio_qmi_svc.c +++ b/sound/usb/usb_audio_qmi_svc.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -806,7 +806,7 @@ static void uaudio_dev_release(struct kref *kref) { struct uaudio_dev *dev = container_of(kref, struct uaudio_dev, kref); - pr_debug("%s for dev %p\n", __func__, dev); + pr_debug("%s for dev %pK\n", __func__, dev); atomic_set(&dev->in_use, 0); |
