Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5885678rwl; Tue, 4 Apr 2023 05:15:08 -0700 (PDT) X-Google-Smtp-Source: AKy350YIh0ZuCAS25UV4/3RW4PwMAw+RpfupAgKVgx1pPoErBdSJvtbblbQFSklzTkfCujHdUpza X-Received: by 2002:aa7:d491:0:b0:501:d3a1:9a52 with SMTP id b17-20020aa7d491000000b00501d3a19a52mr2137221edr.33.1680610508217; Tue, 04 Apr 2023 05:15:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680610508; cv=none; d=google.com; s=arc-20160816; b=j8Y4v23GKU1aa7b7tQQnof2eFOeca0ZK34qy/g4Dak1lqhv7+hqMXgDJgG6sl+jJ6X aJPKoYa1KXoRRDFWJcGuX6J0BmY78VzP8D4jmK7W5UBTsG+Qkvb3bSbQo95zQ91rpeD7 gFWzLebaPnDekW5yHLDhMAuDC34AeUFwDBhqNdfokhMjDsX+kqiq8Cgl7T517L9lT0D3 tFPByKQrrP2S7oNUNGTPJsf5iwx93+5stbLXmJnV+VRwpAaFUwXnKJr3VPQlHvvI3RpZ qguKb+NFGV/tS5L2iBXEOasKu6R8pJ8A3LK9KHaUHM8V1hUShtCSfcUoIruzunk9njLx ajvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Br0Z4alxU7wp3Rhk+RTaZgwypk6DPbZKhOnMSVJGT24=; b=OlF6ZiFLd8ND7w0T0eMrexF7fXPtVsqMO3fH49FwugBnR/u8V21reEwooQPm1GLVL2 tOZZbd/Yg4LOb33xpiMA8gDiO6FgGXVy+3BGLThJUaeUeOpYUBko4hJWMGVdOeeMh7lb 7K9zBtcIPHQ7Iu7ODxboeyBfatAeOHlTZqfsf3kIJHtDSoXYR2RBxAjdNT6sXlhPgR+R UyzVsoK/YMqCB2coqP0LMUdtPcdGhQtE7NLat/cJTMsB6Z0rRf9RPeye4FdTIt1KVoNK mha7iFCOox887oXpC6OKwilp5ACT2r2u/SIVEWPP2kXqNvgtee/duC7KFW/sTp1FABVJ bv8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=QqjCuJgf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n8-20020a056402514800b004bd1a7dba86si1581961edd.410.2023.04.04.05.14.20; Tue, 04 Apr 2023 05:15:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@suse.com header.s=susede1 header.b=QqjCuJgf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234761AbjDDMKL (ORCPT + 99 others); Tue, 4 Apr 2023 08:10:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234360AbjDDMJB (ORCPT ); Tue, 4 Apr 2023 08:09:01 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9193040D7 for ; Tue, 4 Apr 2023 05:03:50 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 3F4FE22A03; Tue, 4 Apr 2023 12:03:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1680609829; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Br0Z4alxU7wp3Rhk+RTaZgwypk6DPbZKhOnMSVJGT24=; b=QqjCuJgfjT1BWsndH125Lho+YjEk1oOumDbtnuy9/lGIQHFI/92h9SK+lz/3+9YQJSYh/1 ZPhC+rRzQr5qcJjSuGWdjfbCd+gfPXLgHjS7wqgtESoRI23jCb7Vd1fr6q0xPeItTGrWU3 WIJK8oOxV/wHkUEtUWIESj8RqC1AXpc= Received: from suse.cz (unknown [10.100.201.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 2B2A32C142; Tue, 4 Apr 2023 12:03:47 +0000 (UTC) Date: Tue, 4 Apr 2023 14:03:47 +0200 From: Petr Mladek To: Jaewon Kim Cc: David Laight , 'Jaewon Kim' , "senozhatsky@chromium.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , GyeongHwan Hong Subject: Re: [RFC] vsprintf: compile error on %09pK Message-ID: References: <694722c9409b43808cfbc1fc9e495016@AcuMS.aculab.com> <20230403104617epcms1p383bacbca705c0d7e4fffca6833050e42@epcms1p3> <20230404101201epcms1p615a6365e64fc6e0a0fa203d41404940c@epcms1p6> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230404101201epcms1p615a6365e64fc6e0a0fa203d41404940c@epcms1p6> X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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-kernel@vger.kernel.org On Tue 2023-04-04 19:12:01, Jaewon Kim wrote: > >From: Jaewon Kim > >> Sent: 03 April 2023 15:40 > >... > >> I wanted to print phys_addr_t type value only when kptr_restrict sysctl is > >> allowed. So I thought I could use %pK for that purpose. And the physical > >> address is not that long. I wanted to make that length short like 9 hex. > > > >Isn't that is the wrong format for physical addresses anyway? > >They can be larger than virtual ones (eg x86 with PAE). > > Yeah, correct. I just used %pK to hide physical address, I thought it could be > leak in security perspective. Could you give me advice how I can hide the > address by default and look the address if kptr_restrict allow it? Could you please send a patch that would show what value you want to print? The initial mail mentioned converting %09lx to %09pK in some driver. Then it included a warning when compiling from mm/page_alloc.o Honestly, I think that you could just use %pK or %p. IMHO, it does not make sense to optimize it for the length. Anyway, there is still the question if the address is really worth printing. Will it really help to locate a potential problem? Best Regards, Petr