[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2038588983.392567.1632401497054.JavaMail.zimbra@sjtu.edu.cn>
Date: Thu, 23 Sep 2021 20:51:37 +0800 (CST)
From: 郭志 <qtxuning1999@...u.edu.cn>
To: Mike Marciniszyn <mike.marciniszyn@...nelisnetworks.com>
Cc: Dennis Dalessandro <dennis.dalessandro@...nelisnetworks.com>,
dledford <dledford@...hat.com>,
linux-rdma <linux-rdma@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] infiniband hfi1: fix misuse of %x in ipoib_tx.c
I have tried using %px rather than %p. However when checking the new patch through scripts/checkpatch.pl, there is a warning: Using vsprintf specifier '%px' potentially exposes the kernel memory layout.
Maybe %pK is the right one?
Thanks.
Guo
----- Original Message -----
From: "Mike Marciniszyn" <mike.marciniszyn@...nelisnetworks.com>
To: "Guo Zhi" <qtxuning1999@...u.edu.cn>, "Dennis Dalessandro" <dennis.dalessandro@...nelisnetworks.com>, "dledford" <dledford@...hat.com>
Cc: "linux-rdma" <linux-rdma@...r.kernel.org>, "linux-kernel" <linux-kernel@...r.kernel.org>
Sent: Thursday, September 23, 2021 1:51:08 AM
Subject: RE: [PATCH] infiniband hfi1: fix misuse of %x in ipoib_tx.c
> Subject: [PATCH] infiniband hfi1: fix misuse of %x in ipoib_tx.c
>
> Pointers should be printed with %p or %px rather than cast to (unsigned long
> long) and printed with %llx.
> Change %llx to %p to print the pointer.
>
> Signed-off-by: Guo Zhi <qtxuning1999@...u.edu.cn>
The unsigned long long was originally used to insure the entire accurate pointer as emitted.
This is to ensure the pointers in prints and event traces match values in stacks and register dumps.
I think the %p will obfuscate the pointer so %px is correct for our use case.
Mike
Powered by blists - more mailing lists