Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mte/kasan: Implementing KASAN memory protection for ARM64 hardware MTE #15461

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions mm/mm_heap/mm_malloc_size.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <assert.h>
#include <debug.h>

#include <nuttx/mm/kasan.h>
#include <nuttx/mm/mm.h>

#include "mm_heap/mm.h"
Expand All @@ -40,10 +41,14 @@
size_t mm_malloc_size(FAR struct mm_heap_s *heap, FAR void *mem)
{
FAR struct mm_freenode_s *node;
size_t size;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not squash to the previous patch

bool flag;

flag = kasan_bypass_save();
#ifdef CONFIG_MM_HEAP_MEMPOOL
if (heap->mm_mpool)
{
ssize_t size = mempool_multiple_alloc_size(heap->mm_mpool, mem);
size = mempool_multiple_alloc_size(heap->mm_mpool, mem);
if (size >= 0)
{
return size;
Expand All @@ -66,5 +71,8 @@ size_t mm_malloc_size(FAR struct mm_heap_s *heap, FAR void *mem)

DEBUGASSERT(MM_NODE_IS_ALLOC(node));

return MM_SIZEOF_NODE(node) - MM_ALLOCNODE_OVERHEAD;
size = MM_SIZEOF_NODE(node) - MM_ALLOCNODE_OVERHEAD;

kasan_bypass_restore(flag);
return size;
}
Loading