From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E57A6C2B9F8 for ; Tue, 25 May 2021 06:21:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7AF1961417 for ; Tue, 25 May 2021 06:21:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7AF1961417 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id CCB386B006C; Tue, 25 May 2021 02:21:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C7AB66B006E; Tue, 25 May 2021 02:21:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B1C056B0070; Tue, 25 May 2021 02:21:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0251.hostedemail.com [216.40.44.251]) by kanga.kvack.org (Postfix) with ESMTP id 807B86B006C for ; Tue, 25 May 2021 02:21:07 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 258043A9E for ; Tue, 25 May 2021 06:21:07 +0000 (UTC) X-FDA: 78178755774.14.D4264F7 Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170]) by imf02.hostedemail.com (Postfix) with ESMTP id 910F240B8CC9 for ; Tue, 25 May 2021 06:21:03 +0000 (UTC) Received: by mail-oi1-f170.google.com with SMTP id b25so29371161oic.0 for ; Mon, 24 May 2021 23:21:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:user-agent:date:message-id :subject:to:cc; bh=6hrdkIi6HZbv/fsV6gwWuvm7eu0V5FUlGVdsdNzIS4U=; b=Fd71g9BWhbHuaTOFPZyr9FzEnxjVg48QdxjA2/puRQvVw/39VC0RaV7IBKU/NNmT1U zM/+lnF4q4Xx8PhJ40wLWtMsvcHcxkfkAGjgbVm2laysHvwy0Vgvhyyb0QES85Oq4KS3 +DDSziglHK1qcz99dCPpVk/4oooEPSYBS2ud0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from :user-agent:date:message-id:subject:to:cc; bh=6hrdkIi6HZbv/fsV6gwWuvm7eu0V5FUlGVdsdNzIS4U=; b=U+EJjf/mflFRK1lpGbFP/tpBFOwfgjmJkaob8EboWQTZDriDYxOMBl28DMA8VLn38O rsw2SsCPDup1sJ84GTyqklrTSWEzWLm/WvxoabrnZU1xbnnI7XchuVE0hafuDF7NVp6v nOoTZ/Sed93+1+qWFieXw+XHtsLtWl857rcEpdQpDsKfm0kn2S1QhdGFpbVIOxIaSwow oqQBJFTjW5Sij7Gyfxy0Sls+hT4u00Q2/uUhLar75CHflKkAQHRyxX/k3QY5+FOajPxk 2RVUhObbw1bLIDI21eLwOwo9D0RrZ0mtCPipheBGn8SbQao8JlkKMGjrBiqvhqGVo+g+ /9Hw== X-Gm-Message-State: AOAM532X42p5c8t7v9z7bs6StwDBzzbiIBld/smm46Ji+PcOzysmPEXO 5SE5jH6N3qwtawQ8weih774ljtsUhrSSoiRxvpDkdw== X-Google-Smtp-Source: ABdhPJxwSLxKwzgc29+eiNZA9mbQbwLwZgXC13/0DCOF35H/4VxBqBPhfG164Xhvm4C/2RmOaGbUJ50j3XkJRFxxIH0= X-Received: by 2002:a05:6808:144e:: with SMTP id x14mr1855471oiv.166.1621923665992; Mon, 24 May 2021 23:21:05 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 25 May 2021 06:21:05 +0000 MIME-Version: 1.0 In-Reply-To: <20210524113213.h33k3t2exr5rlwin@pathway.suse.cz> References: <20210520013539.3733631-1-swboyd@chromium.org> <20210520013539.3733631-3-swboyd@chromium.org> <20210524113213.h33k3t2exr5rlwin@pathway.suse.cz> From: Stephen Boyd User-Agent: alot/0.9.1 Date: Tue, 25 May 2021 06:21:05 +0000 Message-ID: Subject: Re: [PATCH 2/3] slub: Print raw pointer addresses when debugging To: Petr Mladek Cc: Andrew Morton , linux-kernel@vger.kernel.org, Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Vlastimil Babka , linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=Fd71g9BW; dmarc=pass (policy=none) header.from=chromium.org; spf=pass (imf02.hostedemail.com: domain of swboyd@chromium.org designates 209.85.167.170 as permitted sender) smtp.mailfrom=swboyd@chromium.org X-Stat-Signature: zkohkim7t3izzk8tnjpjiiwaw5gea18t X-Rspamd-Queue-Id: 910F240B8CC9 X-Rspamd-Server: rspam02 X-HE-Tag: 1621923663-751933 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Quoting Petr Mladek (2021-05-24 04:32:13) > 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. Ok I'll try to make slub_debug force on no_hash_pointers. > > 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. > Got it. The slub debug messages are usually followed by stuff blowing up and the system crashing but it's possible that the automatic fixup code will save us. When you have things scribbling all over the place it doesn't end well.