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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 210A8C0218B for ; Tue, 21 Jan 2025 13:35:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8714B6B0083; Tue, 21 Jan 2025 08:35:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 820B96B0088; Tue, 21 Jan 2025 08:35:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6C21F6B0089; Tue, 21 Jan 2025 08:35:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 4C5466B0083 for ; Tue, 21 Jan 2025 08:35:45 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 0C8131C777D for ; Tue, 21 Jan 2025 13:35:45 +0000 (UTC) X-FDA: 83031556650.03.EEDC77A Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by imf03.hostedemail.com (Postfix) with ESMTP id 0FBC32000C for ; Tue, 21 Jan 2025 13:35:42 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=nCTsk0HP; spf=pass (imf03.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.167.50 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1737466543; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=vC9prjLnZMFPOfYQNrt/pp7ZcN9z74AGR2rHMIyedu8=; b=PrmGkaAwDF9z0ZIjUjx3h1ZG/1efsOgdAZQx6+1scciimdbmoQgOGCtp3BWsINgM2vZ018 Q2xIHuo1qTU2s48jBoUX9Xwv2kEt2YE9TmapDD6mD+NIru1i4Tf6y5OtPClnlhduXFTl+O hnhHAMy0CcRawooTV9oyBd3lQiXLpbA= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=nCTsk0HP; spf=pass (imf03.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.167.50 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1737466543; a=rsa-sha256; cv=none; b=HzQa+wdG6Oz+/EALDxH8A2jxyiviRhkHl9sJ4tLTulyjOvPHjogDpo9dJWskzBhkKx+/SL Z0BmKEIYlm5JU0p9bIheCSosiupbIWbQPRd3t3ySpHJrbeSQKLchqVWes6twDD7f6/lbnX zBPeg/RwNx+r/BWtiaAu46cUGaDOB9c= Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-5401bd6ccadso5657768e87.2 for ; Tue, 21 Jan 2025 05:35:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737466541; x=1738071341; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=vC9prjLnZMFPOfYQNrt/pp7ZcN9z74AGR2rHMIyedu8=; b=nCTsk0HP1NKHwqhhXwbpNpx1+41/YeYbsVzdBgFQmZbdeqUfkXzM1Sfwphf1ZY5G21 mRcTAKLPbrTrr4zZtGbPn7lGqLtFTLbJ328zyK4yGtxngx5Ef4wsm0ToxwzJUGLanBfo xMo3vDRSnEMxXN75SkYgyKv+AJWa1UhnjUcJ+BGkp86KBC2q6l4UswkYbDwhhozyXGWG huVKu2Yw7LJL8vRqfLZEtG7atUgRperbaNDLeP3W3SlCKcZ9LlZS8/OSLehEGdozWtiw w1N+WoeUhDRVvEVja57cyXkM/FVTZgb00gmpg5jumqUgaX9qDAj3N8JsISYNmvBB+jbH ZHww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737466541; x=1738071341; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vC9prjLnZMFPOfYQNrt/pp7ZcN9z74AGR2rHMIyedu8=; b=AGew/NSOSo5yUJDV5BzcckhuHJ9u3IiAiuGk3PE+lzw6sJE2fKZNcwyTFvrKzIowEf H+gxy7tZiJSf+lSJ3RkhYnNvenVs8aqz8PrU/YzN+KX3fe4FRwSV47i1CDrjsCR5Mo9u +U+7sbaOJHAGr6mt7hZjST/69SQEzUzKKsyTp9h05m5rdJURHn3tsoE2UenS+42OsMcT iwaNuKEeUmCLvLOJ0+BvRvQbUVi/qFFJJjfNooaeVG0qLARz5ogFTZ/BVte/Gv52NNyc 40XHg6D+0RUm1dIMR+S1HL0vc+4arnKCuvburax6UinYAxin1dtfpVgiTjcMqQvOt2I6 Qc/Q== X-Forwarded-Encrypted: i=1; AJvYcCXNmoGveFWyv9PzMk6a14Bo6e8yG+sOSvg+DH+7R2h7wna3llwEWELpsFBUmTkMwz4tDuTyd6iAcA==@kvack.org X-Gm-Message-State: AOJu0YyNxWb/+9846TT7XIUE9IgGVm94qmnXzHfT3nv12C3/c12nCD72 TZ6QPNGT7wqqQozw9RIwVQ10hJkeZMeeTW4eb9LDPdlb5BlX0TNP/csj3icT7A/uUajIWVSop0u RrU7ge3W/1rqnSk8bQwZuGIQAsK8= X-Gm-Gg: ASbGncvd4k69tqgZ6HXitya6fgBKwiVyCW/3lHOyTPgRQv6REUVzSTcfcg8oMLycpwm Hl7rhp4Nay9KWp7ubywxFOFCCYirTQa4p1yKPudm8fR4ai9U242I= X-Google-Smtp-Source: AGHT+IE6GyuwsvYb++gIzom9u9/v1HlvZ8C0bT26sQtgIF30AcMuF4AqvcaPDkOpjXRf/zwPznoObBhJb86djKQPWKg= X-Received: by 2002:ac2:4aca:0:b0:542:6f2a:946a with SMTP id 2adb3069b0e04-5439c21f309mr4121994e87.6.1737466541090; Tue, 21 Jan 2025 05:35:41 -0800 (PST) MIME-Version: 1.0 References: <20250120083023.4162932-1-hyesoo.yu@samsung.com> In-Reply-To: <20250120083023.4162932-1-hyesoo.yu@samsung.com> From: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Tue, 21 Jan 2025 22:35:58 +0900 X-Gm-Features: AbW1kvbxvPx6ce3WPMoa5ZCnfCteUQpfKHbHBANSxP0mMK0M5kNsogtYwq5_Uzg Message-ID: Subject: Re: [PATCH] mm: slub: Print the broken data before restoring slub. To: Hyesoo Yu Cc: janghyuck.kim@samsung.com, Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka , Roman Gushchin , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Chengming Zhou Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 0FBC32000C X-Stat-Signature: eromrrkwu9hk6sutxbbsexzitkapyue4 X-Rspam-User: X-HE-Tag: 1737466542-676729 X-HE-Meta: U2FsdGVkX1+Sg0IL5dQDiqLz/aWm4+zZrvQKj56x4OLsKZjUh1A0TnrfeJIu9x7QQK56EUZ6FwUsxrb/R3SzPoOTCphwl1gSXz5eKmlPh4OI33yrz2a4bM/NzsAoOgPM5w6H3s2g7OfFADqWE8s5Jrray9X96NxJd3VZ+6T1lGMq0Xw+Y11fhUie8ijt3OqGpn/xs8LSbMHenm6x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HdZh3BAjEf60FZq+gbMogVAdsNcBhDH+JVeLc3AeIsA1WmjHp7Y+g6KRUkacmcVT2yYgEjqxtw4PzTvqA0uns20AVT1sUjpxCGXeyTPrj5RiRh6kyNAVHkWzDenNDrnaIMpNZUFOrMuRJF3sXpHKJadI4vqyG 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: List-Subscribe: List-Unsubscribe: On Mon, Jan 20, 2025 at 5:31=E2=80=AFPM Hyesoo Yu w= rote: Let's add Chengming, the author of the commit, to Cc, as he might have some opinions about it. > Previously, the restore occured after printing the object in slub. > After commit 47d911b ("slab: make check_object() more consistent"), at least 12 characters of the commit hash should be used to refer to a comm= it. Documentation/process/submitting-patches.rst states that: You should also be sure to use at least the first twelve characters of the SHA-1 ID. The kernel repository holds a lot of objects, making collisions with shorter IDs a real possibility. Bear in mind that, even if there is no collision with your six-character ID now, that condition may change five years from now. > the bytes are printed after the restore. This information about the bytes > before the restore is highly valuable for debugging purpose. > For instance, in a event of cache issue, it displays byte patterns > by breaking them down into 64-bytes units. Without this information, > we can only speculate on how it was broken. Hence the corrupted regions > are printed prior to the restoration process. Probably this should be considered for -stable releases. What do you think? [1] https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html > diff --git a/mm/slub.c b/mm/slub.c > index c2151c9fee22..48cefc969480 100644 > --- a/mm/slub.c > +++ b/mm/slub.c > @@ -1207,6 +1207,7 @@ check_bytes_and_report(struct kmem_cache *s, struct= slab *slab, > fault[0], value); > > skip_bug_print: > + print_section(KERN_ERR, "Corrupt ", fault, end - fault); I don't think it's supposed to report an error here, per the name of the label "skip_bug_print". Maybe move print_trailer() and add_taint() back to check_bytes_and_report(), and report an error only once and skip reporting if it's already reported? Best, Hyeonggon > restore_bytes(s, what, value, fault, end); > return 0; > } > -- > 2.48.0 >