mm/iob: limit the alignment length of IOB to no less than sizeof(uinptr_t)

avoid crashes caused by four-byte alignment issues.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu
2025-05-13 10:35:37 +08:00
committed by Alan C. Assis
parent 776a6a5d0b
commit 48e9b4fc7a
6 changed files with 14 additions and 15 deletions
+2 -3
View File
@@ -31,6 +31,7 @@
#include <stdint.h>
#include <stdbool.h>
#include <sys/param.h>
#ifdef CONFIG_IOB_NOTIFIER
# include <nuttx/wqueue.h>
@@ -74,9 +75,7 @@
/* Default config of alignment and head padding size */
#if !defined(CONFIG_IOB_ALIGNMENT)
# define CONFIG_IOB_ALIGNMENT 1
#endif
#define IOB_ALIGNMENT MAX(CONFIG_IOB_ALIGNMENT, sizeof(uintptr_t))
/* IOB helpers */
-1
View File
@@ -46,7 +46,6 @@
#include <nuttx/queue.h>
#include <nuttx/wdog.h>
#include <nuttx/fs/fs.h>
#include <nuttx/net/net.h>
#include <nuttx/mm/map.h>
#include <nuttx/tls.h>
#include <nuttx/spinlock_type.h>