[PATCH] sched/task_stack: Fix object_is_on_stack() for KASAN tagged pointers

Qun-wei Lin (林群崴) Qun-wei.Lin at mediatek.com
Sun Nov 17 19:12:59 PST 2024


On Tue, 2024-11-12 at 23:06 -0800, Andrew Morton wrote:
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> On Wed, 13 Nov 2024 12:25:43 +0800 Qun-Wei Lin <
> qun-wei.lin at mediatek.com> wrote:
> 
> > When CONFIG_KASAN_SW_TAGS and CONFIG_KASAN_STACK are enabled, the
> > object_is_on_stack() function may produce incorrect results due to
> > the
> > presence of tags in the obj pointer, while the stack pointer does
> > not
> > have tags. This discrepancy can lead to incorrect stack object
> > detection
> > and subsequently trigger warnings if CONFIG_DEBUG_OBJECTS is also
> > enabled.
> > 
> > Example of the warning:
> 
> Thanks.
> 
> Are we able to identify when this started happening?  ie, a suitable
> Fixes: taret?
> 

The issue has been present since the introduction of
CONFIG_KASAN_STACK. The stack instrumentation was not accounted for in
the object_is_on_stack() function from the beginning.

Thanks!


More information about the Linux-mediatek mailing list