diff options
| author | Vamsi Krishna Samavedam <vskrishn@codeaurora.org> | 2016-11-03 17:50:27 -0700 |
|---|---|---|
| committer | Hemant Kumar <hemantk@codeaurora.org> | 2017-01-05 12:29:19 -0800 |
| commit | f52c946c4e059ffd04fa68bf7459a310c179c248 (patch) | |
| tree | 76b8b7370332c7da74dc88f38b776a63a3b7685b | |
| parent | 04a8aa575b549a56618854d0b7a941ab84c65156 (diff) | |
usb: mon: 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
Zeros. 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: I4d65692f26e9c26dde98a80bb81f134225abaf16
Signed-off-by: Vamsi Krishna Samavedam <vskrishn@codeaurora.org>
| -rw-r--r-- | drivers/usb/mon/mon_text.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/mon/mon_text.c b/drivers/usb/mon/mon_text.c index ad408251d955..060d78d53118 100644 --- a/drivers/usb/mon/mon_text.c +++ b/drivers/usb/mon/mon_text.c @@ -347,7 +347,7 @@ static int mon_text_open(struct inode *inode, struct file *file) rp->r.rnf_error = mon_text_error; rp->r.rnf_complete = mon_text_complete; - snprintf(rp->slab_name, SLAB_NAME_SZ, "mon_text_%p", rp); + snprintf(rp->slab_name, SLAB_NAME_SZ, "mon_text_%pK", rp); rp->e_slab = kmem_cache_create(rp->slab_name, sizeof(struct mon_event_text), sizeof(long), 0, mon_text_ctor); |
