All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Lameter <cl@gentwo.de>
To: Georgi Djakov <georgi.djakov@linaro.org>
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 15:56:04 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2103091554430.109061@gentwo.de> (raw)
In-Reply-To: <20210309134720.29052-1-georgi.djakov@linaro.org>

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.

>  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.


  reply	other threads:[~2021-03-09 15:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-09 13:47 [PATCH] mm/slub: Add slub_debug option to panic on memory corruption Georgi Djakov
2021-03-09 14:56 ` Christoph Lameter [this message]
2021-03-09 14:56   ` Christoph Lameter
2021-03-09 18:12   ` Georgi Djakov
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=alpine.DEB.2.22.394.2103091554430.109061@gentwo.de \
    --to=cl@gentwo.de \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=georgi.djakov@linaro.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.