Re: [Crash-utility] [PATCH] fix "kmem -[sS]" for caches created during SLUB bootstrap

2020-04-09 Thread Dave Anderson


- Original Message -
> Fix for "kmem -[sS]" options on Linux 4.14 and later kernels built
> with CONFIG_SLAB_FREELIST_HARDENED enabled. Without the patch, there
> will error messages of the type "kmem:  slab: 
> invalid freepointer: " for caches created during
> SLUB bootstrap, as they are likely to have s->random == 0.
> 
> Signed-off-by: Hari Bathini 

Hi Hari,

Queued for crash-7.2.9:

  
https://github.com/crash-utility/crash/commit/1ad5a3622f32387b271584d2fe26c07530bcddc9

Thanks,
  Dave


> ---
>  memory.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/memory.c b/memory.c
> index ccc2944..c2433eb 100644
> --- a/memory.c
> +++ b/memory.c
> @@ -19244,7 +19244,7 @@ count_free_objects(struct meminfo *si, ulong
> freelist)
>  static ulong
>  freelist_ptr(struct meminfo *si, ulong ptr, ulong ptr_addr)
>  {
> - if (si->random)
> + if (VALID_MEMBER(kmem_cache_random))
>   /* CONFIG_SLAB_FREELIST_HARDENED */
>   return (ptr ^ si->random ^ ptr_addr);
>   else
> 
> 

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility



[Crash-utility] [PATCH] fix "kmem -[sS]" for caches created during SLUB bootstrap

2020-04-08 Thread Hari Bathini
Fix for "kmem -[sS]" options on Linux 4.14 and later kernels built
with CONFIG_SLAB_FREELIST_HARDENED enabled. Without the patch, there
will error messages of the type "kmem:  slab: 
invalid freepointer: " for caches created during
SLUB bootstrap, as they are likely to have s->random == 0.

Signed-off-by: Hari Bathini 
---
 memory.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/memory.c b/memory.c
index ccc2944..c2433eb 100644
--- a/memory.c
+++ b/memory.c
@@ -19244,7 +19244,7 @@ count_free_objects(struct meminfo *si, ulong freelist)
 static ulong
 freelist_ptr(struct meminfo *si, ulong ptr, ulong ptr_addr)
 {
-   if (si->random)
+   if (VALID_MEMBER(kmem_cache_random))
/* CONFIG_SLAB_FREELIST_HARDENED */
return (ptr ^ si->random ^ ptr_addr);
else


--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility