Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp548621pxb; Thu, 23 Sep 2021 06:02:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwN6EdJ2/2W54NkSrjC/cUbnhmTOeYqVuN7Pv1CZnu8xBsD7F/DFWSkVlhK1YPmYNMWxy98 X-Received: by 2002:a05:6512:10d1:: with SMTP id k17mr3946451lfg.69.1632402146691; Thu, 23 Sep 2021 06:02:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632402146; cv=none; d=google.com; s=arc-20160816; b=nErX2vhioBxngO8oqy3xL1fIeEfoMN1ux5umFWywRf/nqcDCMkt9DCMNQHo58cLyjQ jynewqteo+0LXZoUyqJjPuftkJJ0AdJd9leFhqy15NhxyAiLl2VkpMlrp6NAM+J7cPCm 2ix0X4bFMOeXZ3+hC6YAsY6WDhIdmZuGsLH2xo2ZZ9Ux34iLnDcRrVOtJ0CCdCii9EMR SBSv/acRhgHfh6zvSLcDWFMuF1CYokk+JCN0hr4Xz7ax/K/QwlGkXsacb7G7ZzM9Bbwe t6SoyJJEJes4XHpd+SmXDFkev6wRnPSLrG0yJhXzdpDXOCFNBttfbteE/k1/Iwu5x3KX 44UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date; bh=TjqNH3RbGn9U+ip+Re6UzFRr++vQil6B7uh+7d0PsOA=; b=m+Pk9Mn6Hp+7iJXiL5fDJuTyrFRLZxPFyhy2+w0N9TkqOTy0Cp6dnh5FfOV8Qqm+ag rdPieingDf66/k2q7MpcmoQrcpmXjkFoDLmy9BCGT/9oo7Qtrz7L38BfhwxX64m0d7Oi uhurwhoMMBotY8rTQM93F44/Wb2BMv1lhtMDiFhvS4GcxqWgbDVp2q5UF35vf34ahpPb MkB7uvwNP9rsNum5/eTQDLfp0Epj4aBRRydIRwPG9ctgcrEonb13FBCIDItAW906bfCA vUyhutZXrtTd5jgPWGFD03l+3PVB081jds9cpbBJokzNo5WzJfWC+liIEby+tCDhuaq3 xfDA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v16si6286941ejk.17.2021.09.23.06.01.41; Thu, 23 Sep 2021 06:02:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241164AbhIWM7R (ORCPT + 99 others); Thu, 23 Sep 2021 08:59:17 -0400 Received: from smtp179.sjtu.edu.cn ([202.120.2.179]:56340 "EHLO smtp179.sjtu.edu.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241163AbhIWM7P (ORCPT ); Thu, 23 Sep 2021 08:59:15 -0400 Received: from mta04.sjtu.edu.cn (mta04.sjtu.edu.cn [202.121.179.8]) by smtp179.sjtu.edu.cn (Postfix) with ESMTPS id D3D03100B0956; Thu, 23 Sep 2021 20:57:40 +0800 (CST) Received: from localhost (localhost [127.0.0.1]) by mta04.sjtu.edu.cn (Postfix) with ESMTP id A6EFD185F5217; Thu, 23 Sep 2021 20:57:40 +0800 (CST) X-Virus-Scanned: amavisd-new at mta04.sjtu.edu.cn Received: from mta04.sjtu.edu.cn ([127.0.0.1]) by localhost (mta04.sjtu.edu.cn [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id RQH_rqVoKD0b; Thu, 23 Sep 2021 20:57:40 +0800 (CST) Received: from mstore105.sjtu.edu.cn (unknown [10.118.0.105]) by mta04.sjtu.edu.cn (Postfix) with ESMTP id 4D72C1804EE54; Thu, 23 Sep 2021 20:57:40 +0800 (CST) Date: Thu, 23 Sep 2021 20:57:40 +0800 (CST) From: Guo Zhi To: Greg KH Cc: nsaenz@kernel.org, peterz@infradead.org, maz@kernel.org, bsegall@google.com, rdunlap@infradead.org, airlied@redhat.com, kan liang , odin@uged.al, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-staging@lists.linux.dev, linux-kernel Message-ID: <590112814.393656.1632401860257.JavaMail.zimbra@sjtu.edu.cn> In-Reply-To: References: <20210923035554.669434-1-qtxuning1999@sjtu.edu.cn> Subject: Re: [PATCH] staging: vchip_arm: Fix misuse of %x MIME-Version: 1.0 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 7bit X-Originating-IP: [202.120.40.82] X-Mailer: Zimbra 8.8.15_GA_4125 (ZimbraWebClient - GC92 (Linux)/8.8.15_GA_3928) Thread-Topic: staging: vchip_arm: Fix misuse of %x Thread-Index: m/b7F6kEdO6ZCcPPUHN2BXNzlm0fqQ== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We should restrict kernel pointer leakage issue by using kptr_restrict. Therefore kernel pointers should be specified by %pK rather than %lx. Thanks. Guo ----- Original Message ----- From: "Greg KH" To: "Guo Zhi" Cc: nsaenz@kernel.org, peterz@infradead.org, maz@kernel.org, bsegall@google.com, rdunlap@infradead.org, airlied@redhat.com, "kan liang" , odin@uged.al, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-staging@lists.linux.dev, "linux-kernel" Sent: Thursday, September 23, 2021 1:19:34 PM Subject: Re: [PATCH] staging: vchip_arm: Fix misuse of %x On Thu, Sep 23, 2021 at 11:55:54AM +0800, Guo Zhi wrote: > Pointers should be printed with %p or %px rather than > cast to (unsigned long) and printed with %lx. > Change %lx to %pK to print the pointers. > > Signed-off-by: Guo Zhi > --- > .../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c > index b5aac862a29..408e5fe710b 100644 > --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c > +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c > @@ -591,11 +591,11 @@ service_callback(enum vchiq_reason reason, struct vchiq_header *header, > return VCHIQ_SUCCESS; > > vchiq_log_trace(vchiq_arm_log_level, > - "%s - service %lx(%d,%p), reason %d, header %lx, instance %lx, bulk_userdata %lx", > - __func__, (unsigned long)user_service, > + "%s - service %pK(%d,%p), reason %d, header %pK, instance %pK, bulk_userdata %pK", > + __func__, user_service, > service->localport, user_service->userdata, > - reason, (unsigned long)header, > - (unsigned long)instance, (unsigned long)bulk_userdata); > + reason, header, > + instance, bulk_userdata); Why print this out at all? What uses this? Can it just be deleted? thanks, greg k-h