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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 2FEEBC433E0 for ; Tue, 9 Mar 2021 18:18:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8F555650F5 for ; Tue, 9 Mar 2021 18:18:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8F555650F5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 13FC66B00DD; Tue, 9 Mar 2021 13:18:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 117778D0131; Tue, 9 Mar 2021 13:18:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 02BAA8D012A; Tue, 9 Mar 2021 13:18:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0149.hostedemail.com [216.40.44.149]) by kanga.kvack.org (Postfix) with ESMTP id DB5A96B00DD for ; Tue, 9 Mar 2021 13:18:57 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 966043630 for ; Tue, 9 Mar 2021 18:18:57 +0000 (UTC) X-FDA: 77901147114.19.2ED8C86 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf29.hostedemail.com (Postfix) with ESMTP id 1475C2381 for ; Tue, 9 Mar 2021 18:18:42 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id B503FAEC4; Tue, 9 Mar 2021 18:18:33 +0000 (UTC) Subject: Re: [PATCH] mm/slub: Add slub_debug option to panic on memory corruption To: Georgi Djakov , linux-mm@kvack.org, akpm@linux-foundation.org, cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com Cc: corbet@lwn.net, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Kees Cook References: <20210309134720.29052-1-georgi.djakov@linaro.org> <390d8a2f-ead9-48a9-99eb-65c73bd18422@suse.cz> <6bfebf01-5f52-49bd-380b-04785c474c81@linaro.org> From: Vlastimil Babka Message-ID: <8fd43de6-71e4-cfe7-8208-32753cf1c363@suse.cz> Date: Tue, 9 Mar 2021 19:18:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <6bfebf01-5f52-49bd-380b-04785c474c81@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 1475C2381 X-Stat-Signature: uoz5ng11ecaet9ppf33g89ahkt18wnw7 Received-SPF: none (suse.cz>: No applicable sender policy available) receiver=imf29; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: none/none X-HE-Tag: 1615313922-7223 Content-Transfer-Encoding: quoted-printable 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: On 3/9/21 7:14 PM, Georgi Djakov wrote: > Hi Vlastimil, >=20 > Thanks for the comment! >=20 > On 3/9/21 17:09, Vlastimil Babka wrote: >> On 3/9/21 2:47 PM, Georgi Djakov wrote: >>> Being able to stop the system immediately when a memory corruption >>> is detected is crucial to finding the source of it. This is very >>> useful when the memory can be inspected with kdump or other tools. >> >> Is this in some testing scenarios where you would also use e.g. panic_= on_warn? >> We could hook to that. If not, we could introduce a new >> panic_on_memory_corruption that would apply also for debug_pagealloc a= nd whatnot? >=20 > I would prefer that we not tie it with panic_on_warn - there might be l= ots of > new code in multiple subsystems, so hitting some WARNing while testing = is not > something unexpected. >=20 > Introducing an additional panic_on_memory_corruption would work, but i = noticed > that we already have slub_debug and thought to re-use that. But indeed,= =D0=B0dding > an option to panic in for example bad_page() sounds also useful, if tha= t's what > you suggest. Yes, that would be another example. Also CCing Kees for input, as besides the "kdump ASAP for debugging" case= , I can imagine security hardening folks could be interested in the "somebody mig= ht have just failed to pwn the kernel, better panic than let them continue" angle= . But I'm naive wrt security, so it might be a stupid idea :) Vlastimil > Thanks, > Georgi