From: Georgi Djakov <georgi.djakov@linaro.org>
To: Christoph Lameter <cl@gentwo.de>
Cc: linux-mm@kvack.org, akpm@linux-foundation.org, vbabka@suse.cz,
penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com,
corbet@lwn.net, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/slub: Add slub_debug option to panic on memory corruption
Date: Tue, 9 Mar 2021 20:12:53 +0200 [thread overview]
Message-ID: <a712359c-4671-6f6e-13a1-2a9682a6ec08@linaro.org> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2103091554430.109061@gentwo.de>
Hi Christoph,
Thanks for the comments!
On 3/9/21 16:56, Christoph Lameter wrote:
> On Tue, 9 Mar 2021, 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.
>
> Hmmm.... ok.
The idea is to be able to collect data right after the corruption is
detected, otherwise more data might be corrupted and tracing becomes
more difficult.
>
>> static void restore_bytes(struct kmem_cache *s, char *message, u8 data,
>> void *from, void *to)
>> {
>> + if (slub_debug & SLAB_CORRUPTION_PANIC)
>> + panic("slab: object overwritten\n");
>> slab_fix(s, "Restoring 0x%p-0x%p=0x%x\n", from, to - 1, data);
>> memset(from, data, to - from);
>> }
>
> Why panic here? This should only be called late in the bug reporting when
> an error has already been printed.
This is called by both slab_pad_check() and check_bytes_and_report(), so it
seemed like a common place where i could put the panic(). I can move it to
the caller functions instead, if that's preferred.
Thanks,
Georgi
next prev parent reply other threads:[~2021-03-09 18:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-09 13:47 Georgi Djakov
2021-03-09 14:56 ` Christoph Lameter
2021-03-09 18:12 ` Georgi Djakov [this message]
2021-03-09 15:09 ` Vlastimil Babka
2021-03-09 18:14 ` Georgi Djakov
2021-03-09 18:18 ` Vlastimil Babka
2021-03-18 5:48 ` Kees Cook
2021-03-18 12:56 ` Vlastimil Babka
2021-03-18 17:08 ` Kees Cook
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a712359c-4671-6f6e-13a1-2a9682a6ec08@linaro.org \
--to=georgi.djakov@linaro.org \
--cc=akpm@linux-foundation.org \
--cc=cl@gentwo.de \
--cc=corbet@lwn.net \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=penberg@kernel.org \
--cc=rientjes@google.com \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox