lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250122052736.GA1498496@tiffany>
Date: Wed, 22 Jan 2025 14:27:36 +0900
From: Hyesoo Yu <hyesoo.yu@...sung.com>
To: Hyeonggon Yoo <42.hyeyoo@...il.com>
Cc: janghyuck.kim@...sung.com, Christoph Lameter <cl@...ux.com>, Pekka
	Enberg <penberg@...nel.org>, David Rientjes <rientjes@...gle.com>, Joonsoo
	Kim <iamjoonsoo.kim@....com>, Andrew Morton <akpm@...ux-foundation.org>,
	Vlastimil Babka <vbabka@...e.cz>, Roman Gushchin <roman.gushchin@...ux.dev>,
	linux-mm@...ck.org, linux-kernel@...r.kernel.org, Chengming Zhou
	<chengming.zhou@...ux.dev>
Subject: Re: [PATCH] mm: slub: Print the broken data before restoring slub.

On Tue, Jan 21, 2025 at 10:35:58PM +0900, Hyeonggon Yoo wrote:
> On Mon, Jan 20, 2025 at 5:31 PM Hyesoo Yu <hyesoo.yu@...sung.com> wrote:
> 
> 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 commit.
> 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.
>

Thanks for pointing out the mistake.

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

Thank you for the advice. I will add Cc:stable@...r.kernel.org in the next version.

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

It is good point. I will move print_section above the skip_bug_print label.

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

By passing a new parameter to the check_bytes_and_report(),
It could be implemented. Would it be better to add a new boolean
parameter to that function ? Or do you have any other ideas ?

Thanks,
Hyesoo.

> >         restore_bytes(s, what, value, fault, end);
> >         return 0;
> >  }
> > --
> > 2.48.0
> >
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ