Skip to content
Commit 97b5741a authored by James Harris's avatar James Harris Committed by Anas Nashif
Browse files

logging: fix TOCTTOU issue in z_log_hexdump_from_user



Previously, a racing write to the provided metadata could result
in up to CONFIG_LOG_STRDUP_MAX_STRING-2 bytes after the
end of user-accessible memory being leaked into the strdup pool
or the resulting log.

For now, explicitly copy the metadata string. In an ideal world
this could directly copy from userspace into the strdup buffer, but
this obviously only works if strdup is enabled.

Signed-off-by: default avatarJames Harris <james.harris@intel.com>
parent fd6737eb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment