Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1143317pxb; Thu, 23 Sep 2021 19:59:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyivbgluaVBrNpNviLyXaes2r1z8a/asGhkhhDpy4teHYFPvcOEmsjQTetInmF507yq150q X-Received: by 2002:a05:6e02:16c8:: with SMTP id 8mr6281226ilx.49.1632452346137; Thu, 23 Sep 2021 19:59:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632452346; cv=none; d=google.com; s=arc-20160816; b=B+xzCFGejOo0q1IpZ29fdIYC8L+hZZhnquPo2oVWGMojmr6z3t0LiSOjvOKPQnucEi +5qGgcWskSH23x2bLHZ7s+BEOF3RSg1BIWf/DHgMTMFehiwJstB2x0tcZOzzdXDK9tYC Jg8eGFI//j/iHFOFwBkvUMSh9MqqMUumeep9uzVVORHrItCfASHK5HmSlJFCt/QbH+bR OPk7cgUldnkpDsf8troMT925SVWHO0cPXCTyqEwhFLiH5oyo3dcGeFWnaR4UODcNic5+ xsNeOnB2ymPrQCrWAMei1BHIcDY1HFhJpQGaD0dE+9NO+WMaiIIrtumvRZcRSxr6OZGc U9bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=ZCI/GbzY6MiT1jRhJZCcKnEBCdTDf2Y9MJt0rDDIRFs=; b=OacPfiS717gXW3YdjPi0Hf2YLWvHTZ691YvivwNs3KT/ocHZmmcq++qVH09WjgH5PD UZaw1S996VAUYbYtO/t2F/afaCf3d4OWUb2wDfM8/Bkl68aQB35lBjeKTORYZFYrZI8v yP3NjaCvHh6CRAT82UX8iSwuyMpPgNTrGElEp9QUk6CtfI0G85SSrAZaKKiIsZtw0lPm 38HvKEoy4xsq4OuvTLQ+GH3dcEer3tWujEi3hQdV7uWTMuzO7BVbpLIriPk6VVMznFYE L6fUdClzZ9k824dhges1NXeATGprhE7X7tyTFv/azVIcLGfNnrRShYyagPMNVgunINqU gr1A== 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 b69si8169785jab.32.2021.09.23.19.58.54; Thu, 23 Sep 2021 19:59:06 -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 S243961AbhIXC73 (ORCPT + 99 others); Thu, 23 Sep 2021 22:59:29 -0400 Received: from smtp181.sjtu.edu.cn ([202.120.2.181]:47046 "EHLO smtp181.sjtu.edu.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234930AbhIXC72 (ORCPT ); Thu, 23 Sep 2021 22:59:28 -0400 Received: from proxy02.sjtu.edu.cn (smtp188.sjtu.edu.cn [202.120.2.188]) by smtp181.sjtu.edu.cn (Postfix) with ESMTPS id 6A7D01008CBCD; Fri, 24 Sep 2021 10:57:53 +0800 (CST) Received: from localhost (localhost.localdomain [127.0.0.1]) by proxy02.sjtu.edu.cn (Postfix) with ESMTP id 4CB78200BC2D9; Fri, 24 Sep 2021 10:57:53 +0800 (CST) X-Virus-Scanned: amavisd-new at Received: from proxy02.sjtu.edu.cn ([127.0.0.1]) by localhost (proxy02.sjtu.edu.cn [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id mox-xDx8C2lv; Fri, 24 Sep 2021 10:57:53 +0800 (CST) Received: from [192.168.10.98] (unknown [202.120.40.82]) (Authenticated sender: qtxuning1999@sjtu.edu.cn) by proxy02.sjtu.edu.cn (Postfix) with ESMTPSA id 2FB9E200B5750; Fri, 24 Sep 2021 10:57:19 +0800 (CST) Message-ID: <3159c45c-b417-c157-e108-c0e12af2e122@sjtu.edu.cn> Date: Fri, 24 Sep 2021 10:57:18 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.1 Subject: Re: [PATCH] staging: vchip_arm: Fix misuse of %x Content-Language: en-US To: Greg KH , nsaenz@kernel.org, peterz@infradead.org, maz@kernel.org, bsegall@google.com, rdunlap@infradead.org, airlied@redhat.com, kan.liang@linux.intel.com, odin@uged.al, phil@raspberrypi.com Cc: 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@vger.kernel.org References: <20210923035554.669434-1-qtxuning1999@sjtu.edu.cn> From: Guo Zhi In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/9/23 13:19, Greg KH wrote: > 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 This information is printed for debugging usage. But malicious user process can also print it through debugfs at /sys/kernel/debug. As it can be used for debugging, it's a little radical to just delete. Therefore, I suggest replacing %lx with %pK to avoid kernel address leakage. thanks, Guo