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

Dave Anderson anderson at redhat.com
Thu Apr 9 15:23:42 UTC 2020


----- 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: <cache name> slab: <address>
> invalid freepointer: <obfuscated address>" for caches created during
> SLUB bootstrap, as they are likely to have s->random == 0.
> 
> Signed-off-by: Hari Bathini <hbathini at linux.ibm.com>

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




More information about the Crash-utility mailing list