]> www.infradead.org Git - users/jedix/linux-maple.git/commit
lib/stacktrace, kasan, kmsan: rework extra_bits interface
authorAndrey Konovalov <andreyknvl@google.com>
Fri, 10 Feb 2023 21:16:03 +0000 (22:16 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 10 Feb 2023 23:36:13 +0000 (15:36 -0800)
commitbee982bfc8bbe33d0ca274335b7ab935cf2c3fa0
treefa3d8df16d70e6e2224dfe46ad880df845e31aa3
parent6a6430f2dcccacdb475f2530e1fb1efc3d6b0244
lib/stacktrace, kasan, kmsan: rework extra_bits interface

The current implementation of the extra_bits interface is confusing:
passing extra_bits to __stack_depot_save makes it seem that the extra
bits are somehow stored in stack depot. In reality, they are only
embedded into a stack depot handle and are not used within stack depot.

Drop the extra_bits argument from __stack_depot_save and instead provide
a new stack_depot_set_extra_bits function (similar to the exsiting
stack_depot_get_extra_bits) that saves extra bits into a stack depot
handle.

Update the callers of __stack_depot_save to use the new interace.

This change also fixes a minor issue in the old code: __stack_depot_save
does not return NULL if saving stack trace fails and extra_bits is used.

Link: https://lkml.kernel.org/r/317123b5c05e2f82854fc55d8b285e0869d3cb77.1676063693.git.andreyknvl@google.com
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/stackdepot.h
lib/stackdepot.c
mm/kasan/common.c
mm/kmsan/core.c