diff options
| author | Manu Gautam <mgautam@codeaurora.org> | 2017-02-24 15:22:40 +0530 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2018-11-27 16:09:55 +0100 |
| commit | 513cef2c53c2b3846f6c571823412f514b6f66c7 (patch) | |
| tree | 91c79e2c53b67916729fbfea3150bf7d9571bbdc /sound | |
| parent | b32e2d51665e3b6af648dec474db214b6312d967 (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 'sound')
| -rw-r--r-- | sound/usb/caiaq/audio.c | 14 | ||||
| -rw-r--r-- | sound/usb/caiaq/device.c | 2 | ||||
| -rw-r--r-- | sound/usb/caiaq/midi.c | 2 | ||||
| -rw-r--r-- | sound/usb/usx2y/us122l.c | 6 | ||||
| -rw-r--r-- | sound/usb/usx2y/usX2Yhwdep.c | 2 | ||||
| -rw-r--r-- | sound/usb/usx2y/usbusx2yaudio.c | 12 | ||||
| -rw-r--r-- | sound/usb/usx2y/usx2yhwdeppcm.c | 4 |
7 files changed, 21 insertions, 21 deletions
diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c index c1916184e..3b93e34fc 100644 --- a/sound/usb/caiaq/audio.c +++ b/sound/usb/caiaq/audio.c @@ -104,7 +104,7 @@ static int stream_start(struct snd_usb_caiaqdev *cdev) int i, ret; struct device *dev = caiaqdev_to_dev(cdev); - dev_dbg(dev, "%s(%p)\n", __func__, cdev); + dev_dbg(dev, "%s(%pK)\n", __func__, cdev); if (cdev->streaming) return -EINVAL; @@ -135,7 +135,7 @@ static void stream_stop(struct snd_usb_caiaqdev *cdev) int i; struct device *dev = caiaqdev_to_dev(cdev); - dev_dbg(dev, "%s(%p)\n", __func__, cdev); + dev_dbg(dev, "%s(%pK)\n", __func__, cdev); if (!cdev->streaming) return; @@ -156,7 +156,7 @@ static int snd_usb_caiaq_substream_open(struct snd_pcm_substream *substream) struct snd_usb_caiaqdev *cdev = snd_pcm_substream_chip(substream); struct device *dev = caiaqdev_to_dev(cdev); - dev_dbg(dev, "%s(%p)\n", __func__, substream); + dev_dbg(dev, "%s(%pK)\n", __func__, substream); substream->runtime->hw = cdev->pcm_info; snd_pcm_limit_hw_rates(substream->runtime); @@ -168,7 +168,7 @@ static int snd_usb_caiaq_substream_close(struct snd_pcm_substream *substream) struct snd_usb_caiaqdev *cdev = snd_pcm_substream_chip(substream); struct device *dev = caiaqdev_to_dev(cdev); - dev_dbg(dev, "%s(%p)\n", __func__, substream); + dev_dbg(dev, "%s(%pK)\n", __func__, substream); if (all_substreams_zero(cdev->sub_playback) && all_substreams_zero(cdev->sub_capture)) { /* when the last client has stopped streaming, @@ -209,7 +209,7 @@ static int snd_usb_caiaq_pcm_prepare(struct snd_pcm_substream *substream) struct snd_pcm_runtime *runtime = substream->runtime; struct device *dev = caiaqdev_to_dev(cdev); - dev_dbg(dev, "%s(%p)\n", __func__, substream); + dev_dbg(dev, "%s(%pK)\n", __func__, substream); if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { int out_pos; @@ -292,7 +292,7 @@ static int snd_usb_caiaq_pcm_trigger(struct snd_pcm_substream *sub, int cmd) struct snd_usb_caiaqdev *cdev = snd_pcm_substream_chip(sub); struct device *dev = caiaqdev_to_dev(cdev); - dev_dbg(dev, "%s(%p) cmd %d\n", __func__, sub, cmd); + dev_dbg(dev, "%s(%pK) cmd %d\n", __func__, sub, cmd); switch (cmd) { case SNDRV_PCM_TRIGGER_START: @@ -894,7 +894,7 @@ void snd_usb_caiaq_audio_free(struct snd_usb_caiaqdev *cdev) { struct device *dev = caiaqdev_to_dev(cdev); - dev_dbg(dev, "%s(%p)\n", __func__, cdev); + dev_dbg(dev, "%s(%pK)\n", __func__, cdev); stream_stop(cdev); free_urbs(cdev->data_urbs_in); free_urbs(cdev->data_urbs_out); diff --git a/sound/usb/caiaq/device.c b/sound/usb/caiaq/device.c index 48b63ccc7..123d25e68 100644 --- a/sound/usb/caiaq/device.c +++ b/sound/usb/caiaq/device.c @@ -518,7 +518,7 @@ static void snd_disconnect(struct usb_interface *intf) return; cdev = caiaqdev(card); - dev_dbg(dev, "%s(%p)\n", __func__, intf); + dev_dbg(dev, "%s(%pK)\n", __func__, intf); snd_card_disconnect(card); diff --git a/sound/usb/caiaq/midi.c b/sound/usb/caiaq/midi.c index 2d7588461..8caf35298 100644 --- a/sound/usb/caiaq/midi.c +++ b/sound/usb/caiaq/midi.c @@ -82,7 +82,7 @@ static void snd_usb_caiaq_midi_send(struct snd_usb_caiaqdev *cdev, ret = usb_submit_urb(&cdev->midi_out_urb, GFP_ATOMIC); if (ret < 0) dev_err(dev, - "snd_usb_caiaq_midi_send(%p): usb_submit_urb() failed," + "snd_usb_caiaq_midi_send(%pK): usb_submit_urb() failed," "ret=%d, len=%d\n", substream, ret, len); else cdev->midi_out_active = 1; diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c index 999550bba..52d9e0ab5 100644 --- a/sound/usb/usx2y/us122l.c +++ b/sound/usb/usx2y/us122l.c @@ -192,7 +192,7 @@ static int usb_stream_hwdep_open(struct snd_hwdep *hw, struct file *file) { struct us122l *us122l = hw->private_data; struct usb_interface *iface; - snd_printdd(KERN_DEBUG "%p %p\n", hw, file); + snd_printdd(KERN_DEBUG "%pK %pK\n", hw, file); if (hw->used >= 2) return -EBUSY; @@ -213,7 +213,7 @@ static int usb_stream_hwdep_release(struct snd_hwdep *hw, struct file *file) { struct us122l *us122l = hw->private_data; struct usb_interface *iface; - snd_printdd(KERN_DEBUG "%p %p\n", hw, file); + snd_printdd(KERN_DEBUG "%pK %pK\n", hw, file); if (us122l->dev->descriptor.idProduct == USB_ID_US144 || us122l->dev->descriptor.idProduct == USB_ID_US144MKII) { @@ -614,7 +614,7 @@ static int snd_us122l_probe(struct usb_interface *intf, return -ENODEV; } - snd_printdd(KERN_DEBUG"%p:%i\n", + snd_printdd(KERN_DEBUG"%pK:%i\n", intf, intf->cur_altsetting->desc.bInterfaceNumber); if (intf->cur_altsetting->desc.bInterfaceNumber != 1) return 0; diff --git a/sound/usb/usx2y/usX2Yhwdep.c b/sound/usb/usx2y/usX2Yhwdep.c index 0b34dbc8f..bc83295b1 100644 --- a/sound/usb/usx2y/usX2Yhwdep.c +++ b/sound/usb/usx2y/usX2Yhwdep.c @@ -48,7 +48,7 @@ static int snd_us428ctls_vm_fault(struct vm_area_struct *area, get_page(page); vmf->page = page; - snd_printdd("vaddr=%p made us428ctls_vm_fault() page %p\n", + snd_printdd("vaddr=%pK made us428ctls_vm_fault() page %pK\n", vaddr, page); return 0; diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c index cd69a80b5..f36c23c90 100644 --- a/sound/usb/usx2y/usbusx2yaudio.c +++ b/sound/usb/usx2y/usbusx2yaudio.c @@ -265,7 +265,7 @@ static void usX2Y_clients_stop(struct usX2Ydev *usX2Y) for (s = 0; s < 4; s++) { struct snd_usX2Y_substream *subs = usX2Y->subs[s]; if (subs) { - snd_printdd("%i %p state=%i\n", s, subs, atomic_read(&subs->state)); + snd_printdd("%i %pK state=%i\n", s, subs, atomic_read(&subs->state)); atomic_set(&subs->state, state_STOPPED); } } @@ -373,7 +373,7 @@ static void i_usX2Y_subs_startup(struct urb *urb) static void usX2Y_subs_prepare(struct snd_usX2Y_substream *subs) { - snd_printdd("usX2Y_substream_prepare(%p) ep=%i urb0=%p urb1=%p\n", + snd_printdd("usX2Y_substream_prepare(%pK) ep=%i urb0=%pK urb1=%pK\n", subs, subs->endpoint, subs->urb[0], subs->urb[1]); /* reset the pointer */ subs->hwptr = 0; @@ -757,7 +757,7 @@ static int snd_usX2Y_pcm_hw_params(struct snd_pcm_substream *substream, struct snd_card *card = substream->pstr->pcm->card; struct list_head *list; - snd_printdd("snd_usX2Y_hw_params(%p, %p)\n", substream, hw_params); + snd_printdd("snd_usX2Y_hw_params(%pK, %pK)\n", substream, hw_params); // all pcm substreams off one usX2Y have to operate at the same rate & format list_for_each(list, &card->devices) { struct snd_device *dev; @@ -780,7 +780,7 @@ static int snd_usX2Y_pcm_hw_params(struct snd_pcm_substream *substream, } } if (0 > (err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)))) { - snd_printk(KERN_ERR "snd_pcm_lib_malloc_pages(%p, %i) returned %i\n", + snd_printk(KERN_ERR "snd_pcm_lib_malloc_pages(%pK, %i) returned %i\n", substream, params_buffer_bytes(hw_params), err); return err; } @@ -795,7 +795,7 @@ static int snd_usX2Y_pcm_hw_free(struct snd_pcm_substream *substream) struct snd_pcm_runtime *runtime = substream->runtime; struct snd_usX2Y_substream *subs = runtime->private_data; mutex_lock(&subs->usX2Y->prepare_mutex); - snd_printdd("snd_usX2Y_hw_free(%p)\n", substream); + snd_printdd("snd_usX2Y_hw_free(%pK)\n", substream); if (SNDRV_PCM_STREAM_PLAYBACK == substream->stream) { struct snd_usX2Y_substream *cap_subs = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]; @@ -830,7 +830,7 @@ static int snd_usX2Y_pcm_prepare(struct snd_pcm_substream *substream) struct usX2Ydev *usX2Y = subs->usX2Y; struct snd_usX2Y_substream *capsubs = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]; int err = 0; - snd_printdd("snd_usX2Y_pcm_prepare(%p)\n", substream); + snd_printdd("snd_usX2Y_pcm_prepare(%pK)\n", substream); mutex_lock(&usX2Y->prepare_mutex); usX2Y_subs_prepare(subs); diff --git a/sound/usb/usx2y/usx2yhwdeppcm.c b/sound/usb/usx2y/usx2yhwdeppcm.c index 814d0e887..7e1139063 100644 --- a/sound/usb/usx2y/usx2yhwdeppcm.c +++ b/sound/usb/usx2y/usx2yhwdeppcm.c @@ -359,7 +359,7 @@ static int snd_usX2Y_usbpcm_hw_free(struct snd_pcm_substream *substream) struct snd_usX2Y_substream *subs = runtime->private_data, *cap_subs2 = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE + 2]; mutex_lock(&subs->usX2Y->prepare_mutex); - snd_printdd("snd_usX2Y_usbpcm_hw_free(%p)\n", substream); + snd_printdd("snd_usX2Y_usbpcm_hw_free(%pK)\n", substream); if (SNDRV_PCM_STREAM_PLAYBACK == substream->stream) { struct snd_usX2Y_substream *cap_subs = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]; @@ -485,7 +485,7 @@ static int snd_usX2Y_usbpcm_prepare(struct snd_pcm_substream *substream) struct usX2Ydev *usX2Y = subs->usX2Y; struct snd_usX2Y_substream *capsubs = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]; int err = 0; - snd_printdd("snd_usX2Y_pcm_prepare(%p)\n", substream); + snd_printdd("snd_usX2Y_pcm_prepare(%pK)\n", substream); if (NULL == usX2Y->hwdep_pcm_shm) { if (NULL == (usX2Y->hwdep_pcm_shm = snd_malloc_pages(sizeof(struct snd_usX2Y_hwdep_pcm_shm), GFP_KERNEL))) |
