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

Commit 4ce2c515 authored by Vamsi Krishna Samavedam's avatar Vamsi Krishna Samavedam Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarVamsi Krishna Samavedam <vskrishn@codeaurora.org>
parent 20768179
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -352,7 +352,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);