Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3338157pxj; Mon, 24 May 2021 04:33:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBIntlRh0mn4y9SckBtRlTvMXt/vI8GL4TeEtLNxvvmqrpasnAI9xGUK0eprcDHrd9nnkk X-Received: by 2002:a17:906:c14b:: with SMTP id dp11mr23084587ejc.351.1621856023943; Mon, 24 May 2021 04:33:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621856023; cv=none; d=google.com; s=arc-20160816; b=ju5x80iPflD8cgfzKfgIf+xBOkXlotPgdIlpMpltCMJ5Xee8BQvBnk2DB9yMZYZOUL CepDrvIqO9g7b+UAF1N/zkw6q2kcDCG0mTqXTdOnIs+UuQw2TQd/b4L13jRnCTiV0Eor 9L2jRwHK9fPXlRNWJa/3CuUIgAqlSFH1keP6s+SrYdzLQhK6l/i9mFUTiGnOmWnYQoqU oJW3cKar3AI69h2rsUQpAYEoNxG4abTLQDujufc6aZj+u7uDst7NPbViUZOO+Bf+Sl4w PtwQnpk8KA6CuOGXkuteOgolrCNgQu+Tgx8IB5vHlO4rpmC2RF2KnF5Yx6EPZl3Ybs9G XpTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=l4+YR55d73GMIRIIlhwxLCsLisFSGbrwblla1Qo1l+U=; b=jTn743wnPF14OkDqnRLJdzzXmjNoEbrVmpJQbvYZ6VilHcyMnhO6m2cg7xZ+kzs7wC tFuXYQHESpZc+CU1LezqM+u/lISfj4ha/SfU3jhbWgK/Hkzq0t7UcY0P5xgcSguP3qvr IfKNnwTCkh7z92u2qlTurnbWWc5W2+t+/1Jbz1rokbbQcf7sqSHFGCkhAqXMRM+qtsOm QIkj6hXWVxbQuomwacyajA30Ta48dyUKpMokwsMWAP59bDENYGI273R7KrhTBsmjU1ZJ HgJWEXIcgAnjadR2wBM45AHtcrWKPSgcelTpjj66wl+97M5Ak5XKRvbm7ZfjzQnR3eap n+SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="HC/MwSOY"; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u15si14017850edt.43.2021.05.24.04.33.09; Mon, 24 May 2021 04:33:43 -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; dkim=pass header.i=@suse.com header.s=susede1 header.b="HC/MwSOY"; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232563AbhEXLdn (ORCPT + 99 others); Mon, 24 May 2021 07:33:43 -0400 Received: from mx2.suse.de ([195.135.220.15]:39516 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232050AbhEXLdm (ORCPT ); Mon, 24 May 2021 07:33:42 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1621855933; 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=l4+YR55d73GMIRIIlhwxLCsLisFSGbrwblla1Qo1l+U=; b=HC/MwSOYsmtSMg+sZk4b9YxGLPj9SzNWvf6WXi+952zumYJshJGJaqKgk9p4bd5VnmEb90 RtGn5D4y3BNZQP3ywjsnqmUUTa4hoz1V3Bl0nzMu45nF2MaCkKOD5ciF2ZhgxQG+bo8ma/ OdRyaifMK23g+QrvhVyVSEkyGWa60ao= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 86CF6AD8A; Mon, 24 May 2021 11:32:13 +0000 (UTC) Date: Mon, 24 May 2021 13:32:13 +0200 From: Petr Mladek To: Stephen Boyd Cc: Andrew Morton , linux-kernel@vger.kernel.org, Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Vlastimil Babka , linux-mm@kvack.org Subject: Re: [PATCH 2/3] slub: Print raw pointer addresses when debugging Message-ID: <20210524113213.h33k3t2exr5rlwin@pathway.suse.cz> References: <20210520013539.3733631-1-swboyd@chromium.org> <20210520013539.3733631-3-swboyd@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210520013539.3733631-3-swboyd@chromium.org> User-Agent: NeoMutt/20170912 (1.9.0) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 2021-05-19 18:35:38, Stephen Boyd wrote: > Obscuring the pointers that slub shows when debugging makes for some > confusing slub debug messages: > > Padding overwritten. 0x0000000079f0674a-0x000000000d4dce17 > > Those addresses are hashed for kernel security reasons. If we're trying > to be secure with slub_debug on the commandline we have some big > problems given that we dump whole chunks of kernel memory to the kernel > logs. Let's use %px here and dump buffers with the actual address for > the buffer instead of the hashed version so that the logs are > meaningful. This also helps if a kernel address is in some slub debug > report so we can figure out that the object is referencing itself. Please, do not do this! Use "no_hash_pointers" commandling option when you want to see raw pointers. It will make it clear when the kernel logs are save and when not. If "slub_debug" is useless with hashed pointers then it might enable "no_hash_pointers". But make sure that it prints the fat warning. This patch is the worst approach. We have to keep the number of "%px" callers at minimum to keep it maintainable. The only safe use-case is when the system is in panic() [*]. If the pointers might be printed at any time then users should be warned by the fat message printed by "no_hash_pointers". [*] Raw pointers are currently printed also by Oops/WARN messages. It is from historic reasons. Anyway, they are fat warnings on its own. The system often need to get reported anyway. Best Regards, Petr