Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp10716552rwp; Fri, 21 Jul 2023 04:01:27 -0700 (PDT) X-Google-Smtp-Source: APBJJlEoTp1b8QpiuNpU0fDsW4wP+a9zIbdwRk2gKFmdXE4sMkoV0X8Fvk2rdlPo/9jwx4hlFayk X-Received: by 2002:a17:90a:f004:b0:263:30a0:643f with SMTP id bt4-20020a17090af00400b0026330a0643fmr988283pjb.21.1689937287703; Fri, 21 Jul 2023 04:01:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689937287; cv=none; d=google.com; s=arc-20160816; b=Qf7Hl1GfrJBJ0izqexciIj8Ac9NRUAx60GdH+poX23wGbP/aIuwDWMNK00c8p9Q+12 jJ9JszCdOHiE7HqcYNW9CLtMn7CwI4w3ivfw7Vjll7r0FGzDWADKOddIvDgTMQU5sZv/ +CgKTUbvg53N3dleEyV9TV1iksvmLZALrdDjxiHYNTXi5PBJYm+Iq4BTOzHjDvFti5zX fazMwRLPvusMQNKvZHpp3vw00d+6Hj3qavaophpQ5XSZK44aHlMLmbe3hMJTfKvcv2RN D6mrk+AZRsP1sZO49qJt5voF4O1bu7l+vBUdirDTsd8tQBwvX+ravetZxLw3AjUJhwec EQ4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :from; bh=g0/y5gTWfkk2JQzH50DsaOTRZD0cVu75wCoJfKdJ2OE=; fh=ahSJz/aQ2GBzMX/uyWlL+URDUVtQJ/BRbeYEvCp5SFs=; b=aNw4q4UHXLfwp5EFZRkujhgsFu5jh6IOb3zb/DjiAdh5V6s3nyM5JhE8yhUE1BA7yw JdCGTUq7dagGowIps21tky7PPonP/G7PyMlu+1EErbeR5wlxmNSdcgDuW5/sf1HWhdhH IzcySVQJcuSxS0492Kju279n95V3egY2l+Yf39KX2air+Wpr4li3fwNeE1NYwjQY6kr4 9yokPgKZhG7v+e3g2Y0o4Vke8Fki7xwNbohacAb1KSaBFfJ9OE9zqVmwoeCQ8tw4Na5/ UagVPYjZ7IYU8FBP0NXTowTWfA3gtudR6ELwMTcINJdiP+CZXgu+QCe9Vcd887Lv81zo f1IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@toke.dk header.s=20161023 header.b=PWMbcVtk; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=toke.dk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o21-20020a17090ac71500b0026395d2aa4dsi5408566pjt.67.2023.07.21.04.01.17; Fri, 21 Jul 2023 04:01:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@toke.dk header.s=20161023 header.b=PWMbcVtk; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=toke.dk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231226AbjGUK6M (ORCPT + 58 others); Fri, 21 Jul 2023 06:58:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230369AbjGUK6B (ORCPT ); Fri, 21 Jul 2023 06:58:01 -0400 Received: from mail.toke.dk (mail.toke.dk [45.145.95.4]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFF821731; Fri, 21 Jul 2023 03:57:55 -0700 (PDT) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=toke.dk; s=20161023; t=1689937072; bh=g0/y5gTWfkk2JQzH50DsaOTRZD0cVu75wCoJfKdJ2OE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=PWMbcVtkEqNmU46vpk63Tnbr2JrWwSYk7IAd6DTKGqbgTLkLUyDa5M3GerO4zAYiZ TA+WUkOOEly1rNgnWB4Pqw7Wjq/WzkEkC4YK3qyLNmhscyk7F7i6XY4kyHfuhHP5GF FedWZnnCLQgm40Mh77ejdeNUcLbDKRxusGMWcrhTleg5q5a/1eU+fx+2qvmRZNuLIV k/zNUavZyEAoHsR5yDABj1E3r9v6NWSm3ZntwFIu5c89SXo1TF/M3KbpJb/d890kft Wt6YNqJEPV7lY2O1T6gnZgR1lpDxpF8qruaKIVoyRSx93ALGRSWp4PYis5ihgyOj+O y8mBhQSDNSjIg== To: Dongliang Mu , Jonas Gorski Cc: Kalle Valo , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] wifi: ath9k: fix printk specifier In-Reply-To: References: <20230706111700.14305-1-dzm91@hust.edu.cn> <87cz15s2gv.fsf@toke.dk> <87a5w7hm46.fsf@toke.dk> Date: Fri, 21 Jul 2023 12:57:52 +0200 X-Clacks-Overhead: GNU Terry Pratchett Message-ID: <87y1j9sf9r.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Dongliang Mu writes: > On 2023/7/7 21:44, Toke H=C3=B8iland-J=C3=B8rgensen wrote: >> Jonas Gorski writes: >> >>> On Thu, 6 Jul 2023 at 13:39, Toke H=C3=B8iland-J=C3=B8rgensen wrote: >>>> Dongliang Mu writes: >>>> >>>>> Smatch reports: >>>>> >>>>> ath_pci_probe() warn: argument 4 to %lx specifier is cast from pointer >>>>> ath_ahb_probe() warn: argument 4 to %lx specifier is cast from pointer >>>>> >>>>> Fix it by modifying %lx to %p in printk. >>>>> >>>>> Signed-off-by: Dongliang Mu >>>> Third time is the charm! :) >>>> >>>> Acked-by: Toke H=C3=B8iland-J=C3=B8rgensen >>> But do we *want* to replace %lx with %p? Because this now causes a >>> change in behavior, as the kernel will omit the pointer's address, >>> while before it printed the actual memory address. Using %px would >>> have kept the original behavior. >> So this is basically an informational log message, which really >> shouldn't be leaking kernel pointer addresses. So I think %p is the >> right choice here, and if someone wants to see the real address for >> debugging they should be booting with no_hash_pointers. >> >>> So if the change is desired, it should be noted in the commit message. >> That is a fair point, documenting this in the commit message would be >> good... > > Hi Toke, > > What's the next? Patch v4 with a note at the end, like the following, > > "Note that %p would by default print a hashed value without leaking the=20 > kernel pointer to user space." Yes, please send a new version with the explanation added. However, this should include not just *what* is changed, but *why* as well. So maybe something like: "Note that with this change, the pointer address will be printed as a hashed value by default. This is appropriate because the kernel shouldn't leak kernel pointers to user space in an informational message. If someone wants to see the real address for debugging purposes, this can be achieved using the no_hash_pointers kernel option" -Toke