Re: [PATCH] mm/cma: change print format of pointer in pr_debug() With %p, the pointer will be hashed and print (____ptrval____) instead.

From: Matthew Wilcox
Date: Wed Dec 27 2023 - 04:56:52 EST


On Wed, Dec 27, 2023 at 06:18:25AM +0000, Xiaobing Luo wrote:
> [ 0.070467] cma: cma_alloc(cma (____ptrval____), count 256, align 8)
> [ 0.073003] cma: cma_alloc(): returned (____ptrval____)
>
> Use 0x%px instead of %p to print the pointer. Then the print will be like:
>
> [ 0.054963] cma: cma_alloc(cma 0xffffffde9ad42a60, count 256, align 8)
> [ 0.057385] cma: cma_alloc(): returned 0xfffffffe003b0000

Please explain why we should leak this information to userspace,
making it easy for an attacker?